public static < K , V , E > Map < K , V > collectEntries ( Iterator < E > self , Map < K , V > collector , @ ClosureParams ( FirstParam . FirstGenericType . class ) Closure < ? > transform ) { while ( self . hasNext ( ) ) { E next = self . next ( ) ; addEntry ( collector , transform . call ( next ) ) ; } return collector ; }
A variant of collectEntries for Iterators using a supplied map as the destination of transformed entries .