static Map mergeWithReverseMap(Map map) { Map map2 = cloneMap(map); for (A key, value : map) { map2.put(value, key); } ret map2; }