<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/a-zipping-gatherer-epoeylcze" -->

---
title: A Zipping Gatherer | daily.dev
description: Java lacks a native zip() method for streams, requiring third-party libraries like Google Guava. Java 22 introduces stream gatherers (JEP 461) as a preview...
canonical: https://daily.dev/posts/a-zipping-gatherer-epoeylcze
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: A Zipping Gatherer | daily.dev
og:description: Java lacks a native zip() method for streams, requiring third-party libraries like Google Guava. Java 22 introduces stream gatherers (JEP 461) as a preview...
og:url: https://daily.dev/posts/a-zipping-gatherer-epoeylcze
og:image: https://api.daily.dev/og/posts/EPOeYLCzE.png
og:image:alt: A Zipping Gatherer
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# A Zipping Gatherer

**[Gunnar Morling](https://daily.dev/sources/gunnar-morling)** · 4 min read · 0 upvotes · 0 comments

## Summary

Java lacks a native zip() method for streams, requiring third-party libraries like Google Guava. Java 22 introduces stream gatherers (JEP 461) as a preview API, enabling custom intermediary stream operations. A custom zipping gatherer implementation is demonstrated that connects two streams element-by-element, applying a user-provided function to each pair. The implementation stops when either stream is exhausted, with notes on how left-join semantics could be added. A limitation is that this gatherer cannot be parallelized due to the inability to access the second stream's spliterator during parallel subdivision. An ObjToIntZipper variant is also provided to avoid int boxing overhead.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.morling.dev/blog/zipping-gatherer/>

## Similar posts on daily.dev

- [Java Stream Gatherers: From Built-in Patterns to Custom Pipeline Mechanics](https://daily.dev/posts/java-stream-gatherers-from-built-in-patterns-to-custom-pipeline-mechanics-x43ce9wlo) · Foojay.io · 2 upvotes · 0 comments
- [JEP Cafe \#24 – Inside.java](https://daily.dev/posts/jep-cafe-24-inside-java-qfjrlhjaw) · Inside Java · 0 upvotes · 0 comments
- [High-performance programming with Java streams](https://daily.dev/posts/high-performance-programming-with-java-streams-sh9mglzje) · InfoWorld · 0 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java), [#functional-programming](https://daily.dev/tags/functional-programming)

[View this post on daily.dev](https://daily.dev/posts/a-zipping-gatherer-epoeylcze)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"A Zipping Gatherer","url":"https://daily.dev/posts/a-zipping-gatherer-epoeylcze","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/a-zipping-gatherer-epoeylcze"},"datePublished":"2026-03-16T08:14:11.422Z","dateModified":"2026-03-16T08:28:42.929Z","description":"Java lacks a native zip() method for streams, requiring third-party libraries like Google Guava. Java 22 introduces stream gatherers (JEP 461) as a preview...","image":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","thumbnailUrl":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","isAccessibleForFree":true,"articleSection":"Gunnar Morling","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Gunnar Morling","logo":"https://media.daily.dev/image/upload/s--77UJH_xq--/f_auto,q_auto/v1773648773/logos/gunnar-morling?_a=BAMAMiiu0","url":"https://daily.dev/sources/gunnar-morling"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/a-zipping-gatherer-epoeylcze","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"java,functional-programming","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Gunnar Morling","item":"https://daily.dev/sources/gunnar-morling"},{"@type":"ListItem","position":3,"name":"A Zipping Gatherer"}]}
```

