пример слияния карты Java
map.merge(keyValue[0], Long.parseLong(keyValue[1]), (oldValue, newValue) -> oldValue + newValue);
Inna Kim
map.merge(keyValue[0], Long.parseLong(keyValue[1]), (oldValue, newValue) -> oldValue + newValue);