title: How to make java 8 Stream map continuously with null check
body: <p>I have this piece of code</p>
  
  <pre><code>Coverage mainCoverage = illus.getLifes().stream()
      .filter(Life::isIsmain)
      .findFirst()
      .orElseThrow(() -&gt; new ServiceInvalidAgurmentGeneraliException(env.getProperty("MSG_002")))
      .getCoverages()  
      .stream() // &lt;==may cause null here if list coverage is null
      .filter(Coverage::isMainplan)
      .findFirst()
      .orElseThrow(() -&gt; new ServiceInvalidAgurmentGeneraliException(env.getProperty("MSG_002")));
  </code></pre>
  
  <p>which is totally work fine but I think It's a little bit messy and not cover all the <code>null pointer exception</code> possible (see the comment).</p>
  
  <p>I try to refactor this code into</p>
  
  <pre><code>Coverage mainCoverage1 = illus.getLifes().stream()
      .filter(Life::isIsmain)
      .map(Life::getCoverages)
      .filter(Coverage::isMainplan) //&lt;== cannot filter from list coverage to one main coverage
      ...
  </code></pre>
  
  <p>Seem after I map the life to coverage it is not a list of coverage anymore. 
  So the question is how I can refactor the first section into null safe and maybe shorten it?</p>