In this lecture, we cover aggregating operations in the Stream API: how to count with
count(), compute sums and averages with primitive streams (
IntStream,
LongStream,
DoubleStream) and the methods
sum(),
average(), as well as how to find extrema via
min()/
max(). We will also discuss working with the containers
Optional,
OptionalInt,
OptionalLong,
OptionalDouble and the right ways to extract values:
orElse(...),
ifPresent(...),
orElseThrow(). You’ll learn to use collectors like
Collectors.summingInt,
Collectors.averagingInt,
Collectors.maxBy/
minBy and combine them with
groupingBy. At the end—an overview of common mistakes and nuances.