Why not look at this:
https://github.com/google/guava/wiki/NewCollectionTypesExplained#multimap
MultiMap
allows you to store multiple values for a given key in a very efficient way.
In your case, great advantage is that you are not forced to retrieve a value (Set
) from a given key in order to add some values to it.
Indeed, you just have to add the value to the key as if you deal with "monovalue" and it will be automatically added to the set
in background.