The Stream API (Java 8+) lets you process collections declaratively using pipelines of intermediate operations (filter, map, sorted, distinct) and terminal operations (toList(), collect(), reduce(), count()) without mutating the original list.
ADVERTISEMENT