public static <E, R> R reduce(E[] array, BiFunction<R, E, R> function, R init) {
        return new Reductor<>(function, init).apply(new ArrayIterator<E>(array));
    }
public static < E , R > R reduce ( E [ ] array , BiFunction < R , E , R > function , R init ) { return new Reductor < > ( function , init ) . apply ( new ArrayIterator < E > ( array ) ) ; }
Reduces an array of elements using the passed function.

@param <E> the element type parameter
@param <R> the result type parameter
@param array the array to be consumed
@param function the reduction function
@param init the initial value for reductions
@return the reduced value