title: Approach to convert Double to OptionalDouble
body: <p>I have a new method that builds a list and I want it to return the sum of the list as an OptionalDouble value.</p>
  
  <p>However, when I calculate the sum value using Java 8, I always get the return value as a Double.</p>
  
  <p>How do I convert</p>
  
  <pre><code>Double to OptionalDouble
  </code></pre>
  
  <p>Below are my code for sum calculation:</p>
  
  <pre><code>private static OptionalDouble sumListValue() {
       // Build list
       List&lt;Double&gt; testList = new ArrayList&lt;&gt;();
       testList.add(...);
       ...
       ...
  
  
       return testList.stream().mapToDouble(value -&gt; value).sum();
  }
  </code></pre>
  
  <p>Thanks.</p>