public < K > Multimap < K , T > groupBy ( Function < ? super T , K > function ) { return Multimaps . index ( each ( ) , function ) ; }
Treating each element in the delegate as a value applies a function t determine the key and uses the multimap to group all values with the same key .