I need to create a map where the Integer corresponds with the maintenance periods a car has scheduled and with the set being the cars that have that amount of periods.
I'm getting these errors: Lambda expression's signature does not match the signature of the functional interface method get()
AND
The method getValue() is undefined for the type T - The method size() is undefined for the type T I'm using eclipse if thats of any help. Any help would be greatly appreciated.
private Map<Integer, Set<Auto>> summarize(Map<String, List<Maintenance>> carMaintenanceMap) {
//carMap is <String, Car>
Map<Integer, Set<Car>> map = new HashMap<>() ;
map = carMaintenanceMap.entrySet().stream()
.collect(Collectors.toMap(
entry ->
entry.getValue(), val -> val.size() ,
entry ->
entry.getKey(), k -> this.carMap.entrySet().stream()
.filter(entry -> entry.getKey().equals(k)µ
.collect(Collectors.toSet())
));
}