public static String hashForJson(String json) {

        String regularizedJson = removeWhiteSpaceFromJson(json);

        return computeHashFor(regularizedJson);
    }
@Test
    public void hashesAreTheSame() {

        String input1 = "{\"a\":123,\"b\":456}";
        String input2 = "{\n\"a\":123,\n\"b\":456\n}";
        String input3 = "{\n  \"a\":123,\n  \"b\":456\n}";
        String input4 = "{\n  \"a\": 123,\n  \"b\": 456\n}";

        String hash1 = HashUtils.hashForJson(input1);
        String hash2 = HashUtils.hashForJson(input2);
        String hash3 = HashUtils.hashForJson(input3);
        String hash4 = HashUtils.hashForJson(input4);

        assertThat(hash1.equals(hash2), is(true));
        assertThat(hash2.equals(hash3), is(true));
        assertThat(hash4.equals(hash4), is(true));
    }