title: Calculating the sum of values of a map in Java 8 stream which can contain invalid numbers
body: <p>I have a map: <code>Map&lt;String, Map&lt;String, String&gt;&gt; x</code> </p>
  
  <p>I want to calculate the sum of values in my second map for this: </p>
  
  <pre><code>x.values().stream().mapToDouble(y -&gt; Double.parse(y.get("myKey"))).sum();
  </code></pre>
  
  <p>However if y.get("myKey") is not a valid number it will throw an error as expected...is there a way I can avoid it and pass only valid numbers</p>
  
  <p>I see that Doubles.tryParse from guava library is there which will return null incase it is not parsable. But I am not able to figure out how I can use that to sum only the valid numbers. </p>