I have a class Person with constructor
Person(Fruit... favoriteFruits) {}
And 3 objects (let's say)
Person A = new Person(Apple);
Person B = new Person(Banana, Papaya);
Person C = new Person(Pineapple, Orange);
and a method in class Person Fruit[] getFavouriteFruits(){}
Using streams, I am trying to convert this into Map
Expected Output: Map of ((Apple, A), (Banana, B), (Papaya, B), (Pineapple, C), (Orange, C))
Not sure how to flatten the Array of Fruits into a stream