title: Lazy evaluation of Optional
body: <p>Is it possibile to have an <code>java.util.Optional</code> which is evaluated only if needed?</p>
  
  <p>I need to pass an <code>Optional</code> to a method (of an API that I cannot change), and this method may or may not make use the value of that <code>Optional</code>. Since the value is computed by a heavy operation, I'd like to compute that value only when (and if) it is needed, e.g. calling <code>get()</code>, <code>orElseGet()</code>, <code>ifPresent()</code>, etc.</p>
  
  <p>Something like <code>Optional.ofLazy(Supplier&lt;T&gt; computeValue)</code>.</p>