public static <E> Iterator<E> tap(E[] array, Consumer<E> consumer) {
        return new TransformingIterator<E, E>(new ArrayIterator<E>(array), new Tapper<E>(consumer));
    }
public static < E > Iterator < E > tap ( E [ ] array , Consumer < E > consumer ) { return new TransformingIterator < E , E > ( new ArrayIterator < E > ( array ) , new Tapper < E > ( consumer ) ) ; }
Creates an iterator yielding each element of the source array after
applying the passed consumer. This application is evaluated lazily when the
resulting iterator is consumed. E.g:
<code>
tap([1,2,3], sideEffect) -> [1, 2, 3]
</code>

@param <E> the element type parameter
@param array the array
@param consumer the consumer to be applied
@return an iterator that when consumed applies a side effect to every
element