Skip to content

Instantly share code, notes, and snippets.

@briandoll
Created January 14, 2009 01:38
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 briandoll/46734 to your computer and use it in GitHub Desktop.
Save briandoll/46734 to your computer and use it in GitHub Desktop.
public void testSnappyHappy() {
Map snappy = null;
Map happy = new HashMap();
addToMap(snappy, "foo", "bar");
addToMap(happy, "foo", "bar");
}
private Map addToMap(Map map, String key, String value){
if (map == null){
map = new HashMap();
}
map.put(key, value);
return map;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment