ı am trying to merge more than one hashmaps also sum the values of same key, ı want to explain my problem with toy example as follows
HashMap
If you are using Java 8, you can use the new merge method of Map.
m2.forEach((k, v) -> m.merge(k, v, (v1, v2) -> v1 + v2));