If I have the value \"foo\", and a HashMap ftw for which ftw.containsValue(\"foo\") returns true, how can I
\"foo\"
HashMap ftw
ftw.containsValue(\"foo\")
true
There is no unambiguous answer, because multiple keys can map to the same value. If you are enforcing unique-ness with your own code, the best solution is to create a class that uses two Hashmaps to track the mappings in both directions.