How merge multiple maps and aggregate values results using Java preferred Java8
<p>Let's say i have multiple N maps with-> key:string val:Object</p>

<p>I want to merge all of them into one big map , and sum their object filed values:</p>

<p>for instance:</p>

<pre><code>import java.util.HashMap;
import java.util.Map;

/**
 * Created by vitaly on 21/07/2016.
 */
public class Merge {

    static Map&lt;String, Container&gt; map1 = new HashMap&lt;&gt;();
    static Map&lt;String, Container&gt; map2 = new HashMap&lt;&gt;();
    static Map&lt;String, Container&gt; map3 = new HashMap&lt;&gt;();


    public void initMaps() {
        map1.put("aaa", new Container(1, "title_aaa"));
        map1.put("bbb", new Container(4, "title_bbb"));

        map2.put("ccc", new Container(7, "title_ccc"));
        map2.put("aaa", new Container(10, "title_aaa"));

        map3.put("aaa", new Container(13, "title_aaa"));
        map3.put("bbb", new Container(16, "title_bbb"));
        ...
        mapN.put(...
    }

    class Container {
        public Container(int val1, String title) {
            this.val1 = val1;
            this.title = title;

        }

        int val1;
        String title;

    }

    public static void main(String[] args) {
        Merge.mergeMaps(map1, map2, map3);
    }

    public static Map&lt;String, Container&gt; mergeMaps(Map... maps) {
        /**
         * HOW create one merged map that sums the values
         */
// The result should be: 
        //map(aaa, {24,title_aaa )   //1+10+13
        //map(bbb, {20,title_ccc )   //4+16
        //map(ccc, {7,title_ccc )   //7
        return map;
    }
}
</code></pre>

<p>Prefer Java 8 but it doesn't matter :)</p>

<p>Thanks a lot!</p>