Creating an Optional The Optional<T> class models the absence of a value by a special singleton returned by the Optional.empty()…

Mapping Adapter for Downstream Collectors The mapping() method of the Collectors class encapsulates a mapper function and a downstream collector…

Multilevel Partitioning Like the groupingBy() method, the partitioningBy() operation can be used in multilevel classification. The downstream collector in a…

Flat Mapping Adapter for Downstream Collectors The flatMapping() method of the Collectors class encapsulates a mapper function and a downstream…

Finishing Adapter for Downstream Collectors The collectingAndThen() method encapsulates a downstream collector and a finisher function to allow the result…

Querying an Optional The presence of a value in an Optional can be determined by the isPresent() method, and the…

Collecting to an Array The overloaded method toArray() can be used to collect or accumulate into an array. It is…

Numeric Optional Classes An instance of the generic Optional<T> class can only encapsulate an object. To deal with optional numeric…

Matching Elements The match operations determine whether any, all, or none of the stream elements satisfy a given Predicate. These…

16.7 Terminal Stream Operations A stream pipeline does not execute until a terminal operation is invoked on it; that is,…