[Solved] Convert a Collection to Map using java 8 streams [closed]


This is actually quite simple, despite the convoluted solutions others have offered:

Map<String, List<String>> map = placements.stream()
        .collect(groupingBy(Placement::getFutureLinkId, mapping(Placement::getId, toList())));

1

solved Convert a Collection to Map> using java 8 streams [closed]