title: How return null by using Stream API?
body: <p>So, I have an <code>ArrayList</code> of autogenerated strings. I want to find the first element that contains some character or else if there is no one element that matches this filter, to apply another filter. In another way, I want to return <code>null</code> object.</p>
  
  <p>So I write this lambda expression:</p>
  
  <pre><code>str.stream()
     .filter(s -&gt; s.contains("q"))
     .findFirst()
     .orElseGet(() -&gt; str.stream()
                         .filter(s -&gt; s.contains("w"))
                         .findFirst()
                         .orElseGet(null))
  </code></pre>
  
  <p>But if there is no one element that matches this two filters I will have NullPointerException. How, can I get something like: <code>return null</code>?</p>