Skip to content

Instantly share code, notes, and snippets.

@fdaoud
Created November 3, 2011 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fdaoud/1337575 to your computer and use it in GitHub Desktop.
Save fdaoud/1337575 to your computer and use it in GitHub Desktop.
public Map swapKeys(Map map, Object key1, Object key2) {
Object val1 = map.get(key1);
map.put(key1, map.get(key2);
map.put(key2, val1);
return map;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment