code: public static <T> Collection<T> collect(Object self, Collection<T> collector, Closure<? extends T> transform) {
          for (Iterator iter = InvokerHelper.asIterator(self); iter.hasNext(); ) {
              collector.add(transform.call(iter.next()));
          }
          return collector;
      }
docs: Iterates through this aggregate Object transforming each item into a new value using the <code>transform</code> closure
  and adding it to the supplied <code>collector</code>.
  
  @param self      an aggregate Object with an Iterator returning its items
  @param collector the Collection to which the transformed values are added
  @param transform the closure used to transform each item of the aggregate object
  @return the collector with all transformed values added to it
  @since 1.0