title: Java stream. Only once
body: <p>Is there a way to make my stream iterate only once, after my filter is true?</p>
  
  <p>Example:</p>
  
  <pre><code>list.stream()
      .filter(ele -&gt; ele.isBlue())
      .map(Element::getSomething)
      .collect(toList());
  </code></pre>
  
  <p>Say I have many elements in my list, but only one is blue. And I know that only one is blue, but I dont know where is it. And for arguments sake, lets say that isBlue() is a slow method, so I want to stop when it hits once.</p>