private static int compareStrings(final String str1, final String str2) {
        final char[] arr1 = str1.toCharArray();
        final char[] arr2 = str2.toCharArray();

        for (int i = 0; i < arr1.length; i++) {
            // If arr2 finishes here then the strings are unequal at this index.
            if (arr2.length == i) {
                return i;
            }

            final char c1 = arr1[i];
            final char c2 = arr2[i];

            // If the characters at this index are not equal then this is where
            // the mismatch occurs.
            if (c1 != c2) {
                return i;
            }
        }

        // If arr2 goes on to be longer than arr1 then return a mismatch that is
        // equal to the length of arr1.
        if (arr1.length < arr2.length) {
            return arr1.length;
        }

        return -1;
    }
Provides methods that are used by multiple tests.
stroom-test-common/src/main/java/stroom/test/common/ComparisonHelper.java