« All Java trainings

Combined Training: Java Streams Basics + Advanced

Duration: 3 days
Format: virtual or on-site

Overview

This three-day combined training merges the content of two individual courses – Java Streams Basic and Java Streams Advanced – and gives you a practical and in-depth understanding of the Java Stream API: from the basics and best practices to advanced techniques like Custom Collectors and Stream Gatherers.

On the first day, you'll learn the functional programming fundamentals and the structure of stream pipelines:

  • Role of intermediate and terminal operations
  • Differences from collections
  • Benefits of lazy evaluation
  • Stream creation using collections, arrays, files, and ranges

All of this is directly applied in hands-on exercises – the perfect foundation for the advanced topics on days two and three.

On days two and three, the focus shifts to efficiency, extensibility, and modern techniques:

  • Developing custom collectors (including characteristics and finisher)
  • Analyzing and optimizing stream pipelines
  • Writing custom spliterators and understanding their performance benefits
  • Infinite streams, directory walking, and file streams
  • Stream Gatherers API (Java 22+): using built-ins, writing custom gatherers, managing state

You’ll gain a deep understanding of how streams work internally – and you'll be equipped to confidently decide when and how to use streams effectively – and when it’s better not to.

The course concludes with a comprehensive final project, where you'll model a real-world data processing scenario using streams – from requirements through stream design to a performant solution. We’ll review your results together and discuss best practices for production-ready stream code.

Request in-house training »

👉 Just looking for the basics? Check out Java Streams Basics – Practical Fundamentals for Beginners.

👉 Only want the advanced topics? Then Java Streams Advanced – Gatherers, Spliterators & More might be the better fit.

Target Audience

This course is designed for Java developers who want to learn how to use the Streams API efficiently and elegantly – from the ground up – and then immediately take the next step: focusing on performance, extensibility, and modern features like gatherers or custom spliterators.

It’s ideal for anyone seeking a comprehensive knowledge of Java Streams in a short time – for example, during a technology upgrade, relaunch, or refactoring project.

Course Details

Duration: 3 days
Date by arrangement
Exclusively for your team
Delivered on-site or online
Customizable content
Language: English or German
Certificate of completion included

Pricing

On-site:  € 6.230,–
plus trainer travel expenses
Virtual:  € 5.120,–
Prices exclude VAT and any customization fees.

Agenda

This course combines the content of both individual trainings. We start with the fundamentals and then progressively dive into advanced techniques – with plenty of examples, exercises, and space for your questions.

Day 1: Streams Basics

Functional Programming in Java:
  • Lambda expressions: syntax, types, and usage
  • Functional interfaces (Consumer, Supplier, Function, Predicate, etc.)
  • Method references: static, instance, constructor references
  • Hands-on exercises: Lambda expressions vs. anonymous classes
Stream Basics:
  • What is a stream? Conceptual differences from collections
  • Anatomy of a stream pipeline: Source → Intermediate Operations → Terminal Operations
  • Lazy evaluation and its implications
  • Creating streams: from collections, arrays, files, ranges
  • Primitive streams: IntStream, LongStream, DoubleStream
  • Hands-on exercises: First stream pipelines with primitive streams
Intermediate Operations Deep Dive:
  • Transformations with map(), flatMap(), filter()
  • Selection and sorting: distinct(), sorted(), limit(), skip()
  • Debugging with peek() – used correctly
  • Chaining operations and performance aspects
  • Hands-on exercises: More complex data processing
Terminal Operations:
  • collect() – the most versatile terminal operator
  • Built-in collectors: toList(), toSet(), toMap()
  • forEach(), forEachOrdered()
  • reduce() for aggregations
  • Finding operations: findFirst(), findAny()
  • Matching operations: allMatch(), anyMatch(), noneMatch()
  • Hands-on exercises: Terminal operations with standard collectors

Days 2 and 3: Streams Advanced

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 (Java 22+)

  • 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

Request In-House Training

Inquiry Training Specific Course (#31)

Your Trainer: Sven Woltmann

Sven Woltmann

I’m a Java expert with over 20 years of experience – as a developer, architect, CTO, performance coach, and trainer.

I’ve designed enterprise-scale systems for companies like 1&1, IONOS, and ICE Services, modernized legacy apps, and helped teams build robust, maintainable, and high-performance Java software.

With HappyCoders.eu, I’ve built one of the most widely read Java blogs in the German-speaking world. I speak at conferences and Java User Groups – and often receive praise for making complex technical topics easy to understand.

What you’ll get from my courses:

  • Extensive experience: Deep Java knowledge with real-world expertise
  • Practical focus: Plenty of hands-on exercises drawn from actual project work
  • Knowledge sharing: Space for your questions, discussions, and real-life challenges
  • Tailored to your team: Content can be flexibly adapted to your goals

I don’t just teach features – I show you how to develop better software with a deep understanding of Java.

More about me »

Format & Requirements

Related Trainings