Returns an Optional describing the first element of this stream,
or an empty Optional if the stream is empty. If the stream has
no encounter order, then any element may be returned.
This is a short-circuiting terminal operation.
Optional describing the first element of this stream,
or an empty Optional if the stream is empty
NullPointerException | if the element selected is null |
Diagram: Stream