title: Summing up BigDecimal in a map of list of objects in Java
body: <p>I'm stuck with some elegant ways to get a summation of <code>BigDecimal</code>s in a map. I know how to calculate the sum in a map of <code>BigDecimal</code> but not a List of object with a <code>BigDecimal</code>.</p>
  
  <p>The structure of my objects are as below:</p>
  
  <pre><code>Class Obj {
    private BigDecimal b;
    // Getter for b, say getB()
  }
  
  Map&lt;String, List&lt;Obj&gt;&gt; myMap;
  </code></pre>
  
  <p>I need to get a sum of all <code>b</code>s in <code>myMap</code>. Looking for some elegant ways to do this in Java, may be using streams?</p>