code: 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;
      }
docs: A variant of collectEntries for Iterators using a supplied map as the destination of transformed entries.
  
  @param self      an Iterator
  @param collector the Map into which the transformed entries are put
  @param transform the closure used for transforming, which has an item from self as the parameter and
  should return a Map.Entry, a Map or a two-element list containing the resulting key and value
  @return the collector with all transformed values added to it
  @since 1.8.7