title: Java stream peek not setting the value to object
body: <p>I am working with Steam's API, while iterating parent and child objects. I see some issues. How can I fix this?</p>
  <pre><code>  parent.getChild().stream().filter(child -&gt;
          child.getStatus().equals(&quot;Pending&quot;) &amp;&amp;
            child.Date() != null &amp;&amp; child.getDate().equals(LocalDate.now())
      ).peek(child -&gt; child.setStatus(&quot;Updated&quot;));
  </code></pre>
  <p>Above is not making the status as &quot;Updated&quot;, even though the condition matches. But below code works.</p>
  <pre><code>parent.getChild().forEach(child -&gt; {
   if (child.getStatus().equals(&quot;Pending&quot;) &amp;&amp;
        child.Date() != null &amp;&amp; child.getDate().equals(LocalDate.now())) {
          child.setStatus(&quot;Updated&quot;);
        }
   });
  </code></pre>
  <p>Above code with foreach works but not the one with peek. Why is the one with peek not working?</p>