public static boolean substringMatch(CharSequence str, int index, CharSequence substring) {
        if (index + substring.length() > str.length()) {
            return false;
        }
        for (int i = 0; i < substring.length(); i++) {
            if (str.charAt(index + i) != substring.charAt(i)) {
                return false;
            }
        }
        return true;
    }
@Test
    public void testSubstringMatchReturningTrue() {
        StringBuffer stringBuffer = new StringBuffer("ZP~>xz1;");
        assertTrue(StringUtil.substringMatch(stringBuffer, 0, stringBuffer));
    }