package java.util.stream; /** * A stateful intermediate stream operation ({@link IntermediateOp}). Stateful means that state * is accumulated as elements are processed. Examples of stateful operations are sorting, extracting a subsequence * of the input, or removing duplicates. Statefulness has an effect on how the operation can be parallelized. * Stateless operations parallelize trivially because they are homomorphisms under concatenation: * *
* statelessOp(a || b) = statelessOp(a) || statelessOp(b) ** * where {@code ||} denotes concatenation. Stateful operations may still be parallelizable, but are not amenable to * the automatic parallelization of stateless operations. Accordingly, a stateful operation must provide its * own parallel execution implementation ({@link #evaluateParallel(PipelineHelper)}). * * @param