static void replaceKey(Map map, A oldKey, A newKey) { if (map == null || !map.containsKey(oldKey)) ret; map.put(newKey, map.get(oldKey)); map.remove(oldKey); }