The javadoc states that forEachOrdered
I'm a bit confused by the bold part. If you take a parallel stream and then call forEachOrdered on it - does it mean that the "defined encounter order" will be the same order in which the elements were inserted into the stream, so in effect stream.parallel().forEachOrdered() reassembles the parallel stream into it's original order?Performs an action for each element of this stream, in the encounter order of the stream if the stream has a defined encounter order.