title: Summing BigDecimal with Collectors
body: <p>I want to sum the <code>cost</code> property of items in a <code>List</code>.
  I have written a stream to collect these items and perform the sum, using <code>groupingBy()</code>, as illustrated below.</p>
  
  <pre><code>groupingBy(
      ...,
      ...,
      Collectors.summingDouble(e-&gt;e.cost.doubleValue())
  )
  </code></pre>
  
  <p>However, the <code>cost</code> field is a <code>BigDecimal</code>. In the code above, I am converting it to <code>double</code>, which makes me cringe. Is there a "drop-in" method I can write to that effect ? That would be an equivalent of <code>summingBigDecimal()</code>, which does not exist.</p>
  
  <p>This is not a duplicate of <a href="https://stackoverflow.com/questions/22635945/adding-up-bigdecimals-using-streams">Adding up BigDecimals using Streams</a> as the answers are not applicable inside a groupingBy. Agreed with Anthony Garcia.</p>