I have a stream of Map that I want to collect into a single Map>. Does anybody have a suggesti
Map
Map>
Say i had:
Stream> mapStream
Then the answer is:
mapStream.map(Map::entrySet) .flatMap(Collection::stream) .collect(Collectors.groupingBy(Map.Entry::getKey, Collectors.mapping(Map.Entry::getValue, Collectors.toList())));