public static void assertEquals(String message, String expectedStr, String actualStr, JSONCompareMode compareMode)
        throws JSONException {
        if (expectedStr==actualStr) return;
        if (expectedStr==null){
            throw new AssertionError("Expected string is null.");
        }else if (actualStr==null){
            throw new AssertionError("Actual string is null.");
        }
        JSONCompareResult result = JSONCompare.compareJSON(expectedStr, actualStr, compareMode);
        if (result.failed()) {
            throw new AssertionError(getCombinedMessage(message, result.getMessage()));
        }
    }
public static void assertEquals ( String message , String expectedStr , String actualStr , JSONCompareMode compareMode ) throws JSONException { if ( expectedStr == actualStr ) return ; if ( expectedStr == null ) { throw new AssertionError ( "Expected string is null." ) ; } else if ( actualStr == null ) { throw new AssertionError ( "Actual string is null." ) ; } JSONCompareResult result = JSONCompare . compareJSON ( expectedStr , actualStr , compareMode ) ; if ( result . failed ( ) ) { throw new AssertionError ( getCombinedMessage ( message , result . getMessage ( ) ) ) ; } }
Asserts that the JSONArray provided matches the expected string.  If it isn't it throws an
{@link AssertionError}.

@param message Error message to be displayed in case of assertion failure
@param expectedStr Expected JSON string
@param actualStr String to compare
@param compareMode Specifies which comparison mode to use
@throws JSONException JSON parsing error