/** * Returns an infinite sequential ordered {@code IntStreamEx} produced by * iterative application of a function {@code f} to an initial element * {@code seed}, producing a stream consisting of {@code seed}, * {@code f(seed)}, {@code f(f(seed))}, etc. * * <p> * The first element (position {@code 0}) in the {@code IntStreamEx} will be * the provided {@code seed}. For {@code n > 0}, the element at position * {@code n}, will be the result of applying the function {@code f} to the * element at position {@code n - 1}. * * @param seed the initial element * @param f a function to be applied to to the previous element to produce a * new element * @return A new sequential {@code IntStream} * @see #iterate(int, IntPredicate, IntUnaryOperator) */ public static IntStreamEx iterate(final int seed, final IntUnaryOperator f) { return iterate(seed, x -> true, f); }