question: public static void jsonObjectsEquals ( JSONObject o1 , JSONObject o2 ) throws JSONException { if ( o1 != o2 ) { if ( o1 . length ( ) != o2 . length ( ) ) { fail ( "JSONObjects length differ: " + o1 . length ( ) + " / " + o2 . length ( ) ) ; } @ SuppressWarnings ( "unchecked" ) Iterator < String > o1Keys = o1 . keys ( ) ; while ( o1Keys . hasNext ( ) ) { String key = o1Keys . next ( ) ; Object o1Value = o1 . get ( key ) ; Object o2Value = o2 . get ( key ) ; if ( ! jsonValueEquals ( o1Value , o2Value ) ) { fail ( "JSONObject '" + key + "' values differ: " + o1Value + " / " + o2Value ) ; } } } }
target:  Assert that two JSONObjects are equals without enforcing field order.