title: Return empty element from Java 8 map operation
body: <p>Using Java 8 stream what is <strong>the best way</strong> to map a <code>List&lt;Integer&gt;</code> when you have no output for the input Integer ?</p>
  
  <p>Simply return null? But now my output list size will be smaller than my input size...</p>
  
  <pre><code>    List&lt;Integer&gt; input = Arrays.asList(0,1,2,3);
      List&lt;Integer&gt; output = input.stream()
                                  .map(i -&gt; { 
                                      Integer out = crazyFunction(i);
                                      if(out == null || out.equals(0))
                                          return null;
                                      return Optional.of(out);
                                      })
                                  .collect(Collectors.toList());
  </code></pre>