public static < T , K > HashMap < K , T > toHashMap ( Collection < T > entities , Function < T , K > keyMapper ) { return toMap ( entities , keyMapper , HashMap < K , T > :: new ) ; }
Convert a collection to HashMap The key is decided by keyMapper value is the object in collection