public static <S,T> Collection<T> collect(S[] self, Collection<T> collector, @ClosureParams(FirstParam.Component.class) Closure<? extends T> transform) {
        return collect(new ArrayIterator<S>(self), collector, transform);
    }
public static < S , T > Collection < T > collect ( S [ ] self , Collection < T > collector , @ ClosureParams ( FirstParam . Component . class ) Closure < ? extends T > transform ) { return collect ( new ArrayIterator < S > ( self ) , collector , transform ) ; }
Iterates through this Array transforming each item into a new value using the <code>transform</code> closure
and adding it to the supplied <code>collector</code>.
<pre class="groovyTestCase">
Integer[] nums = [1,2,3]
List<Integer> answer = []
nums.collect(answer) { it * 2 }
assert [2,4,6] == answer
</pre>

@param self      an Array
@param collector the Collection to which the transformed values are added
@param transform the closure used to transform each item
@return the collector with all transformed values added to it
@since 2.5.0