- forEachOrdered operation on stream applies a consumer function to each item in a parallel stream, so that item ordering is not affected by parallel processing.
one to three parallel stream
IntStream oneToThreeParallel = IntStream.of(1, 2, 3).parallel();
IntConsumer integerConsumer = i -> log.info(""+i);
log.info("applying forEachOrdered operation to oneToThree parallel stream");