I tried to follow Java 8 List into Map and try to change Set to Map in one list
Instead of looping (which works)
for (Type t : toSet()) {
map.put(Pair.of(t, Boolean.TRUE), this::methodAcceptingMap);
}
I tried with solutions as:
toSet().stream()
.collect(Collectors.toMap(Pair.of(Function.identity(), Boolean.TRUE),
this::methodAcceptingMap));
But got an error converting:
Type mismatch: cannot convert from Pair<Function<Object,Object>,Boolean>
to Function<? super T,? extends K>
My map
private Map<Pair<Type, Boolean>, BiConsumer<Pair<Type, Boolean>, Parameters>> map =
new HashMap<>();