The Multimap
works just fine, but you're replacing the Multimap
in updateMap
with a completely new Multimap
with no entries, and then adding an entry to that.
It looks like you want
updateMap.get(name).put(categorie, v);
or, if you need to create a new Multimap
if you haven't seen name
before,
if (!updateMap.containsKey(name)) {
updateMap.put(name, HashMultimap.<String, Values>create());
}
updateMap.get(name).put(categorie, v);