title: Get cumulative value from a List of Map<String, Integer>
body: <p>I have a <code>List</code> of <code>Map&lt;String, Integer&gt;</code> . Each <code>Map</code> instance contain the productName as key, product price as value.</p>
  
  <pre><code>List&lt;Map&lt;String, Integer&gt;&gt; products = GET_ALL_PRODUCTS();
  </code></pre>
  
  <p>For example the List could contain Maps with the following data : </p>
  
  <p>Map 1:</p>
  
  <pre><code>"prod1" : 10
  "prod2" : 5
  "prod3" : 2
  </code></pre>
  
  <p>Map 2:</p>
  
  <pre><code>"prod3" : 3
  "prod4" : 6
  </code></pre>
  
  <p>Map 3:</p>
  
  <pre><code>"prod1" : 12
  "prod4" : 8
  </code></pre>
  
  <p>I need to generate a new <code>Map&lt;String, Integer&gt;</code> which contains productName as key still, but with the cumulative amount of price for each product as value. That is:</p>
  
  <p><strong>new Map</strong> should contain:</p>
  
  <pre><code>"prod1" : 10+12
  "prod2" : 5
  "prod3" : 2+3
  "prod4" : 6+8
  </code></pre>
  
  <p>I ended up with the following code, I am wondering what is the <strong>most efficient way</strong> to generate this new <code>Map</code>?? </p>
  
  <pre><code>Map&lt;String, Integer&gt; cumulativeMap = new HashMap&lt;String, Integer&gt;();
  for(int i=0; i&lt; products.size(); i++){
      Map&lt;String, Integer&gt; product = products.get(i);
      ...
  }
  </code></pre>