Stream operations
Many of the methods of the Stream interface (those that have a functional interface type as a parameter) are called operations, because they are not implemented as traditional methods. Their functionalities are passed into the methods as a functions. The methods themselves are just shells that call a method of the functional interface, assigned as the type of the method parameter.
For example, let us look at the Stream<T> filter (Predicate<T> predicate) method. Its implementation is based on the call to the boolean test(T) method of the Predicate<T> function. So, instead of saying, "We use the filter() method of the Stream object to select some of the stream elements and skip others," the programmers prefer to say, "We apply ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access