actually that would be a bad idea.
considering you want to handle multiple options at once.
the code would get really messy with flatMap&#x2F;map
another way would be (now consider more options and it will be way more ugly or considering a list of optional where every optional needs to be present to calculate something):<p><pre><code>    if (opt1.isPresent() &amp;&amp; opt2.isPresent() &amp;&amp; opt3.isPresent()) {
      int i1 = opt1.get();
      int i2 = opt2.get();
      int i3 = opt3.get();
    }
</code></pre>
of course scala has a better way of handling that:<p><pre><code>    for (i1 &lt;- opt1; i2 &lt;- opt2; i3 &lt;- opt3) yield (i1, i2, i3)
</code></pre>
But java has no support for generators.
Edit: btw. even Scala has `get()` and it was there a long time even when you need it even less there: <a href="http:&#x2F;&#x2F;www.scala-lang.org&#x2F;api&#x2F;2.11.8&#x2F;index.html#scala.Option@get:A" rel="nofollow">http:&#x2F;&#x2F;www.scala-lang.org&#x2F;api&#x2F;2.11.8&#x2F;index.html#scala.Option...</a>