title: lambda collecting within a ifPresent
body: <p>How can I use the <code>collect</code> method to collect within a nested <code>ifPresent</code> method? </p>
  
  <p>So far this is what I have:</p>
  
  <pre><code>List result = list.stream()
                    .findFirst()
                    .ifPresent(info -&gt; {
                        info.getMap()
                            .stream()
                            .filter( entry -&gt; entry.getKey().equals("test"))
                            .map(entry::getValue)
                            .collect(Collectors.toList())                          
                     });
  </code></pre>