I have a many-to-one mapping in java hashmap. I iterate through all the values by using java.util.HashMap.values()
. Now if I want to delete a particular value and all the corresponding keys, then what should I do?
Will just using java.util.HashMap.remove(Object key)
with one of the keys suffice?