In this answer I attempted to create a static utility method to make a List into a Map:
List
Map
public static Map toMa
You could add a type parameter for the values of the map so they can be different from T:
public static Map toMapBy(List list, Function super T, ? extends K> mapper) { return list.stream().collect(Collectors.toMap(mapper, Function.identity())); }