findFirst abstract method

Optional<int> findFirst()

Returns the first element of the stream, if present.

Example

final first = IntStream.range(1, 5).findFirst(); // Optional(1)

Implementation

Optional<int> findFirst();