Use the simple groupingBy
variant:
Map<String, List<Pojo>> map = pojos
.stream()
.collect(
Collectors.groupingBy(Pojo::getKey)
);
Use the simple groupingBy
variant:
Map<String, List<Pojo>> map = pojos
.stream()
.collect(
Collectors.groupingBy(Pojo::getKey)
);