Skip to content

Instantly share code, notes, and snippets.

Created July 11, 2013 11:53
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 anonymous/5974797 to your computer and use it in GitHub Desktop.
Save anonymous/5974797 to your computer and use it in GitHub Desktop.
public static void main(String[] args) throws JSONException
{
/*
* 12 is 0.75 * hashmap default capacity (16), 0.75 is default load factor before hashmap grows
*/
JSONObject a = new JSONObject();
JSONObject b = new JSONObject();
for (int i = 0; i < 12; i++)
{
String key = String.valueOf(i);
a.put(key, i);
b.put(key, i);
}
for (int i = 12; i < 16; i++)
b.put(String.valueOf(i), i);
for (int i = 12; i < 16; i++)
b.remove(String.valueOf(i));
System.out.println(a);
System.out.println(b);
Assert.assertFalse(a.toString().equals(b.toString()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment