code: public static <S,T> List<T> collect(Iterator<S> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure<T> transform) {
          return (List<T>) collect(self, new ArrayList<T>(), transform);
      }
docs: Iterates through this Iterator transforming each item into a new value using the
  <code>transform</code> closure, returning a list of transformed values.
  
  @param self      an Iterator
  @param transform the closure used to transform each item
  @return a List of the transformed values
  @since 2.5.0