terminal operation
The last step of a stream pipeline, such as toList or count, which runs the pipeline and ends the stream.
A Stream method that produces a result or side effect (toList, collect, count, forEach, reduce, findFirst, anyMatch, ...), triggering evaluation and consuming the stream.
Examples
toList(),count(),forEach(...)andreduce(...)run the pipeline.
See also