Interface Stream<T>

All Superinterfaces:
AutoCloseable, BaseStream<T, Stream<T>>

public interface Stream<T> extends BaseStream<T, Stream<T>>

A stream here is sequential and lazy: each stage pulls one element at a time from the one before it, and only when a terminal operation asks. So an infinite iterate or generate behind a limit ends, findFirst and the anyMatch family stop at the element that decides them, and the side effects of peek happen element by element, in encounter order.

What is not here: spliterators, and with them parallel evaluation. parallel() answers the stream it was called on.