Created
July 11, 2013 11:53
-
-
Save anonymous/5974797 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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