title: Chaining Optionals in Java 8
body: <p>Looking for a way to chain optionals so that the first one that is present is returned.  If none are present <code>Optional.empty()</code> should be returned.</p>
  
  <p>Assuming I have several methods like this:</p>
  
  <pre><code>Optional&lt;String&gt; find1()
  </code></pre>
  
  <p>I'm trying to chain them:</p>
  
  <pre><code>Optional&lt;String&gt; result = find1().orElse( this::find2 ).orElse( this::find3 );
  </code></pre>
  
  <p>but of course that doesn't work because <code>orElse</code> expects a value and <code>orElseGet</code> expects a <code>Supplier</code>.</p>