Stream Gatherers: Write Your Own Stream Operations!
The Java Stream API was introduced with Java 8 in March 2014, providing us with an indispensable tool for data processing. However, the limited set of intermediate operations – filter, map, flatMap, mapMulti, distinct, sorted, peak, limit, skip, takeWhile, and dropWhile – means that more complex data transformations cannot be expressed directly through the Stream API. Operations like window and fold, among many others, are missing if we look at the community’s feature requests. Instead of integrating all these operations into the Stream interface, the JDK team developed a new API that, on the one hand, is used within the JDK itself to provide highly requested intermediate operations and, on the other hand, allows developers to implement their own operations. This new API is called “Stream Gatherers” and was first released as a preview feature (JEP 461) in Java 22 in March 2024, exactly ten years after the introduction of the Stream API. In Java 23, the new API was sent into a second preview round without changes (JEP 473). In this talk, you will learn in theory and practice (including live coding) what Stream Gatherers are and how they work, which Gatherers are already available in the JDK and how to use them effectively, how to implement your own Gatherers, and where the limits of the new API lie. 👉 Links and slides https://www.happycoders.eu/stream-gat... 👉 Article https://www.happycoders.eu/java/strea... 👉 GitHub repository https://github.com/SvenWoltmann/strea... 👉 Interested in regular expert tips on modern Java and in-depth JVM knowledge? Subscribe to the HappyCoders newsletter: https://www.happycoders.eu/newsletter/ 👉 Java Training https://www.happycoders.eu/java-train... 📩 Contact Contact form: https://www.happycoders.eu/contact/ Email: [email protected]

Hexagonal Architecture: Robust Software With Interfaces Instead of Layers

From Compressed OOPs to Compact Headers: JVM Internals Explained Clearly

Go Wins the Cold Start, Loses to the Database Driver

How Netflix Uses Java - 2026 Edition

Creator of C++: Bell Labs, Negative Overhead Abstraction, Mistakes | Bjarne Stroustrup

Session 9 Composition and Query Selectors

Software Testing Course – Playwright, E2E, and AI Agents

Arrays und Listen in Java - Die Unterschiede verständlich erklärt + Wann verwende ich was?

Microsoft's Greed is Finally Backfiring

Cache-Friendly C++ - Jonathan Müller - CppCon 2025

The Strange Math That Predicts (Almost) Anything

Why The Russian Accent Terrifies Everyone

They Lied to You About AI (This Study Proves It)

Knife Expert: Real Knife Defense Is TERRIFYING

Trump Threatens Late Night TV Again, Might Be Upset We Won a Peabody & His Suspicious Health Report

Why the Mongols Vanished After Conquering Everything

One Formula That Demystifies 3D Graphics

I Investigated the Biggest Smartphone Controversy

But what is a convolution?

