We have:
Map<String, List<Object>> map = fillMap();
It is necessary to convert it as elegantly as possible to a List<Pair<String, Object>>
using the Stream API
( Pair
from apache lang3).
For example, it was:
[ a=[obj1,obj2,obj3], b=[obj4,obj5], c=[obj6,obj7] ]
I want to get:
[ Pair{a,obj1}, Pair{a,obj2}, Pair{a,obj3}, Pair{b,obj4}, Pair{b,obj5}, Pair{c,obj6}, Pair{c,obj7} ]