public static < T , K , V , M extends Map < K , V > > M addToMap ( Iterable < T > iterable , Function < ? super T , ? extends K > keyFunction , M map ) { Iterate . forEach ( iterable , new MapCollectProcedure < T , K , V > ( map , keyFunction ) ) ; return map ; }
Iterate over the specified collection applying a specific Function to each element to calculate a key and add the results to input Map . This method will mutate the input Map .