I want to create a Map from a List of Points and have inside the map all entries from the list mapped with the same parentId such as Map<Long, List<Point>>.
I used Collectors.toMap() but it doesn't compile :
Map<Long, List<Point>> pointByParentId = chargePoints.stream()
.collect(Collectors.toMap(Point::getParentId, c -> c));