docs: public static <S,T> Collection<T> collect(Iterator<S> self, Collection<T> collector, @ClosureParams(FirstParam.FirstGenericType.class) Closure<? extends T> transform) {
          while (self.hasNext()) {
              collector.add(transform.call(self.next()));
          }
          return collector;
      }