I already know how to do it the hard way and got it working - iterating over entries and swapping \"manually\". But i wonder if, like so many tasks, this one can be solved
If you don't have a choice to use a third party library, I don't consider the following code so ugly (though some scripting languages do have elegant ways of doing it):
//map must be a bijection in order for this to work properly
public static HashMap reverse(Map map) {
HashMap rev = new HashMap();
for(Map.Entry entry : map.entrySet())
rev.put(entry.getValue(), entry.getKey());
return rev;
}