title: Operations on Java 8 Optional* values.
body: <p>Java 8 has a number of Optional classes, like <code>OptionalDouble</code>, <code>OptionalInt</code>, <code>OptionalLong</code>. </p>
  
  <p>Is there a nice way of operating with Optional values of the same kind? That is, I'd like to be able to do:</p>
  
  <pre><code>OptionalDouble d1 = OptionalDouble.of(1.);
  OptionalDouble d2 = OptionalDouble.of(2.);
  OptionalDouble d3 = OptionalDouble.of(3.);
  
  OptionalDouble result = d1.add(d2).multiply(d3);
  </code></pre>
  
  <p>And of course if any of them are "empty" the result should be empty. After googling around a bit I found a few code samples where people are using those functions (e.g. <code>add</code>) but it's not the part of the API (anymore?).</p>