Skip to content

Java Streams Advanced – Gatherers, Spliterators & More

You already know streams – but when are parallel streams actually faster, and when do they slow you down? How do you build custom collectors that combine cleanly with groupingBy()? And what do Stream Gatherers (Java 24+) make possible that simply wasn’t possible before?

In two days, this course takes your team to the next level of the Java Streams API – clearly explained and directly applicable.

Request now – no obligation
2 days
Individual date
On-site or online
German / English
Customizable content
Certificate of completion

What you’ll learn in this training

💡 New to Java Streams? → Java Streams Basics Training
✅ Already familiar with streams, ready for more? → You’re in the right place.

In this two-day advanced course, you’ll learn how to gain a deep understanding of the Java Stream API and how to apply advanced techniques like custom collectors, gatherers, and spliterators effectively.

Day one focuses on advanced collectors and aggregation techniques. You’ll explore how reduce(), groupingBy(), and downstream collectors work – and how to implement your own custom collectors tailored to your specific requirements. You’ll also develop an intuition for when parallel streams makes sense – and where to avoid common pitfalls.

On day two, we dive into the world of spliterators and the new Gatherers API finalized in Java 24. You’ll learn how to efficiently partition large datasets with custom spliterators, and how to build powerful streaming operations with stream gatherers, including use cases like sliding windows and folding.

Hands-on exercises and a final refactoring workshop ensure that you can apply your knowledge directly – with real value for your projects.

👉 Want the full spectrum of the Stream API in one go? Then the Combined Training Java Streams Basics + Advanced is the right fit for you.

👉 Is your team still working with Java 17 or 21? Then our Java 25 training might also be interesting for you.

Target audience

This course is for experienced Java developers who have already worked with Streams and now want to explore more advanced topics.

If you use Streams regularly, want to improve your code – or are curious about custom Collectors, Gatherers, or Spliterators – this course is for you.

Agenda

Topics are structured progressively. We alternate between advanced theory, practical use cases, and hands-on exercises – always focused on performance, readability, and maintainability.

Advanced Collectors and Reduce Operations:

  • Aggregation with reduce(): concepts and practical use
  • Debugging with peek(): when it’s helpful and when not
  • Grouping: groupingBy(), partitioningBy()
  • Downstream collectors: counting(), summingInt(), averagingDouble()
  • Nested grouping and complex aggregations
  • Joining strings with joining()
  • Hands-on: complex data analysis with collectors

Building Custom Collectors:

  • Understanding the Collector interface: supplier(), accumulator(), combiner(), finisher()
  • Characteristics: CONCURRENT, IDENTITY_FINISH, UNORDERED
  • Implementing simple custom collectors
  • More complex use cases: collecting custom objects
  • Hands-on: writing your own collectors

Stream Performance and Spliterator Basics:

  • When to use streams vs. traditional loops
  • Performance pitfalls: boxing/unboxing, long pipelines
  • Parallel streams: when they make sense, common fork/join pool
  • Memory efficiency and large datasets
  • Understanding spliterators and their role
  • Spliterator characteristics: ORDERED, SIZED, SUBSIZED, CONCURRENT, etc.
  • How characteristics affect stream performance

Legacy Code Refactoring Workshop:

  • Refactoring session: transforming loops into streams
  • Identifying good refactoring candidates
  • Step-by-step transformation of legacy code
  • Performance comparisons: before vs. after
  • Readability vs. performance trade-offs
  • When refactoring is worthwhile – and when it’s not
  • Hands-on: multiple legacy scenarios

Advanced Stream Patterns and Custom Spliterators:

  • Conditional operations with Optional
  • Error handling in streams
  • Implementing custom spliterators for specific data structures
  • Spliterator patterns: tryAdvance(), trySplit(), estimateSize()
  • Improving parallelism with custom spliterators
  • File streams: reading lines, directory walking
  • Infinite streams: generate(), iterate()
  • Hands-on: building a custom spliterator

Stream Gatherers (since Java 22, finalized in Java 24):

  • What are stream gatherers and why were they introduced
  • Understanding the Gatherer interface: integrator(), combiner(), finisher()
  • Built-in gatherers: fold(), scan(), windowFixed(), windowSliding()
  • Implementing your own gatherers
  • State management in gatherers
  • Hands-on: building gatherers for specific use cases

Integration and Architecture Patterns:

  • Streams in repository patterns
  • Functional programming principles with streams
  • Designing stream-based APIs
  • Migration strategies: legacy code to streams
  • Anti-patterns and debugging: avoiding common mistakes
  • Testing stream-based code

Workshop and Problem Solving:

  • Complex real-world project: end-to-end stream pipeline
  • Code review session: analyzing participant code
  • Performance tuning based on real examples
  • Q&A and individual use cases
  • Summary of best practices

Sounds like exactly what your team needs?

Request now – no obligation

Why learn with me?

I’ve been working with Java for over 20 years – as a developer, CTO, trainer, author, and speaker.

In that time, I’ve helped companies modernize complex Java systems, write performant code, and develop their teams sustainably.

With HappyCoders.eu, I’ve built one of the most widely read Java blogs in the German-speaking world, and I regularly speak at conferences and user groups.

My goal: to teach complex topics in a way that is understandable, practical, and immediately applicable.

Rated 4.97 out of 5 on ProvenExpert

More about me

Any questions?

Participation & Booking

Can individuals book this training?

This training can only be booked for teams. If you’d like to attend as an individual, I offer two courses (in German) through ppedv:

How many participants are possible?

I recommend a maximum of 12 participants per training – that way I can give everyone individual attention. There is no minimum: I charge per training, not per person.

How does booking work?

The easiest way is the request form or an email to schulung@happycoders.eu. Right after submitting, you can book a video call via Calendly, where we discuss the details. You’ll then receive a concrete offer from me.

Prerequisites

What prior Java experience is required?

The course assumes that you already have practical experience with the Stream API – you should be familiar with filter(), map(), collect(), and the common standard collectors.

If you’ve never worked with streams before, you’re better off in the Basics course.

What technical requirements do we need?

All participants need an up-to-date IDE with at least Java 24 – I use IntelliJ IDEA myself. Java 24 or later should also be installed in the terminal, as we’ll run some of the exercises there.

Schedule & Content

What does a training day look like?

Each day has six hours of net training time – usually with two short breaks and a longer lunch break in between. We align the exact schedule with your working hours – that’s flexible.

How much time is theory, how much is practice?

About half theory, half practice: a short theory phase is followed directly by applying it to code – with examples from real projects. Listening alone doesn’t help much; the knowledge has to be used immediately for it to stick.

Can we adjust or prioritize individual agenda topics?

Yes, that’s no problem. Dropping topics or weighting them differently – as long as I don’t have to restructure the training materials, there are no extra costs.

If you need more extensive changes – for example, combining content from different courses or adding entirely new topics – I’ll be happy to prepare an individual offer.

What exactly does “customizable content” mean?

Within the existing agenda, the weighting can be adjusted: shortening topics, setting priorities, changing the order. That’s free of charge.

Beyond that, more far-reaching adjustments are possible – such as combining content from different courses or completely new topic blocks. This involves extra effort, so I’ll prepare an individual offer for it.

Format & Materials

Which platform do we use for virtual training?

We usually use Zoom. If you prefer your own platform – for example, Microsoft Teams or Google Meet – I’m happy to work with that. Just let me know in advance.

Do participants receive materials to keep?

Yes. Before the training, you’ll receive the exercises as a Git repository so you can get started right away. After the training, you’ll also receive the slides – including all solutions to the exercises.

Prices & Costs

What do the travel expenses include?

Travel expenses are charged as a flat rate – depending on the training location and the number of overnight stays required. The exact amount is part of the individual offer I’ll send you.

Are there discounts for booking multiple trainings?

Yes. For multiple booked trainings or follow-up bookings, I can offer a volume discount. We’ll discuss this in the video call, and I’ll include it in the offer.

Is this a good fit for your team?

Just write to me – I usually reply within 24 hours.
Or book a free video call right away, and we’ll discuss everything important.

Request now – no obligation