Terminal operations are values or side-effect operations that traverse the pipeline of the intermediate operations and make the appropriate calls. They can process the returned values (forEach(...), forEachOrdered(...)) or they can return any of the following:
- An iterator (such as the iterator() and spliterator() methods)
- A collection (toArray(...), collect(...), by using the Collectors toList(), toSet(), toColletion(), groupingBy(), partitioningBy(), or toMap())
- A specific element (findFirst(), findAny())
- An aggregation (reduction) that could be any of these:
- Arithmetic: min(...), max(...), count() or sum(), average(), and summaryStatistics() specific only to IntStream, LongStream, and DoubleStream.
- Boolean