Given that I have the array of :
Array1 = [100,10,Banana], [101,10,Apple], [102,14,Banana], [103,12,Mango] -- size :4
I want to create a new array which is grouped by the 3rd parameter of Fruits object. So that my array becomes
ArrayFinal = [[100,10,Banana],[102,14,Banana]], [101,10,Apple], [103,12,Mango] -- size : 3
Need the help in respective to java 8. I heard that we can use the Map ,but can anyone give the small code sample or any other implementation guide.