<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>IntelliJ on foojay.io - Friends Of OpenJDK</title><link>https://foojay.io/today/category/intellij/</link><description>Recent content in IntelliJ on foojay.io - Friends Of OpenJDK</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 21 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://foojay.io/today/category/intellij/index.xml" rel="self" type="application/rss+xml"/><item><title>Java Stream Gatherers: From Built-in Patterns to Custom Pipeline Mechanics</title><link>https://foojay.io/today/java-stream-gatherers/</link><pubDate>Wed, 21 Oct 2026 00:00:00 +0000</pubDate><guid>https://foojay.io/today/java-stream-gatherers/</guid><description>&lt;h1 id="java-stream-gatherers-from-built-in-patterns-to-custom-pipeline-mechanics"&gt;Java Stream Gatherers: From Built-in Patterns to Custom Pipeline Mechanics&lt;/h1&gt;&#10;&lt;h2 id="table-of-contents"&gt;Table of Contents&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#1-introduction--context"&gt;1. Introduction &amp;amp; Context&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#11-the-evolution-of-streams"&gt;1.1 The Evolution of Streams&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#12-the-collector-problem"&gt;1.2 The &amp;ldquo;Collector Problem&amp;rdquo;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#13-what-are-stream-gatherers"&gt;1.3 What are Stream Gatherers?&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#2-getting-started-built-in-gatherers-in-action"&gt;2. Getting Started: Built-In Gatherers in Action&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#21-understanding-stream-cardinality"&gt;2.1 Understanding Stream Cardinality&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#22-the-five-ready-to-use-gatherers"&gt;2.2 The Five Ready-to-Use Gatherers&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#221-batching-items-with-windowfixed"&gt;2.2.1 Batching Items with &lt;code&gt;windowFixed&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#222-analyzing-sequences-with-windowsliding"&gt;2.2.2 Analyzing Sequences with &lt;code&gt;windowSliding&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#223-accumulating-values-with-scan"&gt;2.2.3 Accumulating Values with &lt;code&gt;scan&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#224-intermediate-aggregations-with-fold"&gt;2.2.4 Intermediate Aggregations with &lt;code&gt;fold&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#225-bounded-parallelism-with-mapconcurrent"&gt;2.2.5 Bounded Parallelism with &lt;code&gt;mapConcurrent&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#3-leveling-up-from-using-gatherers-to-authoring-your-own"&gt;3. Leveling Up: From Using Gatherers to Authoring Your Own&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#31-when-should-you-write-a-custom-gatherer"&gt;3.1 When Should You Write a Custom Gatherer?&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#32-pipeline-composition-with-andthen"&gt;3.2 Pipeline Composition with &lt;code&gt;andThen()&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#4-under-the-hood-architecture--anatomy-of-custom-gatherers"&gt;4. Under the Hood: Architecture &amp;amp; Anatomy of Custom Gatherers&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#41-anatomy-of-a-gatherert-a-r"&gt;4.1 Anatomy of a &lt;code&gt;Gatherer&amp;lt;T, A, R&amp;gt;&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#42-the-four-building-blocks-initializer-integrator-combiner-finisher"&gt;4.2 The Four Building Blocks (&lt;code&gt;initializer&lt;/code&gt;, &lt;code&gt;integrator&lt;/code&gt;, &lt;code&gt;combiner&lt;/code&gt;, &lt;code&gt;finisher&lt;/code&gt;)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#43-concrete-walkthrough-building-a-custom-gatherer"&gt;4.3 Concrete Walkthrough: Building a Custom Gatherer&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#5-production-ready-gatherers-parallelism-state-and-pitfalls"&gt;5. Production-Ready Gatherers: Parallelism, State, and Pitfalls&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#51-parallel-execution-modes--combiners"&gt;5.1 Parallel Execution Modes &amp;amp; Combiners&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#52-greedy-vs-short-circuiting-integrators"&gt;5.2 Greedy vs. Short-Circuiting Integrators&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#53-state-management--thread-safety"&gt;5.3 State Management &amp;amp; Thread Safety&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#54-gatherer-vs-collector-a-quick-comparison"&gt;5.4 Gatherer vs. Collector: A Quick Comparison&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#6-conclusion"&gt;6. Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#references"&gt;References&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;hr&gt;&#10;&lt;p&gt;&lt;img src="https://foojay.io/today/java-stream-gatherers/StreamGatherers.jpg" alt="Stream Gatherers" title="Stream Gatherers" width="1024" height="559" loading="lazy" decoding="async"&gt;&lt;/p&gt;</description></item></channel></rss>