I have a Map, where the \"value\" is a List of projects:
Map> projectsMap = ...
I want to extract from the map
Thanks @Holger for the answer.
List projects = projectsMap.values().stream().flatMap(List::stream)
.collect(Collectors.toList());
Code to avoid NullPointerException in case a Collection in the value map is Null:
projectsMap.values().stream().filter(Objects::nonNull)
.flatMap(List::stream).collect(Collectors.toList());