I haven’t used Java for about a decade, so I’m not very familiar with streams api.
Your snippet looks good and concise.
One thing I haven’t emphasized enough in the article is that all algorithms there are designed to work with potentially infinite streams