<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Stream on Devops Monk</title><link>https://devops-monk.com/tags/stream/</link><description>Recent content in Stream on Devops Monk</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 04 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://devops-monk.com/tags/stream/index.xml" rel="self" type="application/rss+xml"/><item><title>Stream &amp; Optional API Enhancements (Java 9–11)</title><link>https://devops-monk.com/tutorials/java11/stream-optional-enhancements/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java11/stream-optional-enhancements/</guid><description>Stream API — New Methods (Java 9) Java 9 added four new instance methods to Stream&amp;lt;T&amp;gt;. All are terminal-ish or intermediate operations that make common patterns expressible without workarounds.
takeWhile(Predicate) Returns elements from the beginning of the stream as long as the predicate holds, then stops. The first element that fails the predicate (and all subsequent elements) are discarded.
Stream.of(1, 2, 3, 4, 5, 1, 2) .takeWhile(n -&amp;gt; n &amp;lt; 4) .</description></item></channel></rss>