title: Handle null in stream without filtering
body: <p>I want to iterate over a <code>Map</code> using the streams API, but, if any <code>null</code> occurs in an element of the <code>EntrySet</code>, I want to do some custom handling.</p>
  
  <p>Since , I need custom handling of nulls , I cannot just use <code>Stream::filter</code></p>
  
  <p>Using my current function (<code>MyClass::f</code>),</p>
  
  <pre><code>HashMap&lt;String,String&gt; map =new HashMap&lt;&gt;(); 
  map.entrySet().stream().map(MyClass::f);
  </code></pre>
  
  <p>I get a <code>NullPointerException</code>.</p>