title: How to return the result of an inner method in cascaded streams
body: <p>How can I reduce the following statements using Java Stream API?</p>
  
  <pre><code>String code = "searchcode";
  Inner result;
   for (Outer outer : outerList) {
          for (Middle middle : outer.getMiddleList()) {
              Inner inner = middle.getResultForCode(code);
                  if (inner != null) {
                     result = inner;
                  }
          }
      }
  </code></pre>
  
  <p>I want to get "inner" or "inner.getRelevantThing()" </p>
  
  <p>something like:</p>
  
  <pre><code>Optional&lt;Inner&gt; result = outerList.forEach(middle -&gt;
      middle.stream()
      .filter(middle.getResultForCode(code))
      .findFirst());
  </code></pre>