title: Java Hashmap: How to get key from value?
body: <p>If I have the value <code>"foo"</code>, and a <code>HashMap&lt;String&gt; ftw</code> for which <code>ftw.containsValue("foo")</code> returns <code>true</code>, how can I get the corresponding key? Do I have to loop through the hashmap? What is the best way to do that?</p>