### Question:
StrMatchUtils { public static boolean isMatch(String str, String exp) { int strIndex = 0; int expIndex = 0; int starIndex = -1; while (strIndex < str.length()) { char pkgChar = str.charAt(strIndex); char expChar = expIndex < exp.length() ? exp.charAt(expIndex) : '\0'; if (pkgChar == expChar) { strIndex++; expIndex++; } else if (expChar == '*') { starIndex = expIndex; expIndex++; } else if (starIndex != -1) { expIndex = starIndex + 1; strIndex++; } else { return false; } } while (expIndex < exp.length() && exp.charAt(expIndex) == '*') { expIndex++; } return expIndex == exp.length(); } private  StrMatchUtils(); static boolean isMatch(String str, String exp);  }### Answer:
@Test public void testIsMatch() { Assert.assertTrue(isMatch("cn.myperf4j.config.abc", "cn.myperf4j*abc")); Assert.assertTrue(isMatch("cn.myperf4j.config.abc", "*.myperf4j*abc")); Assert.assertTrue(isMatch("cn.myperf4j.config.abc", "*.myperf4j*a*c")); Assert.assertFalse(isMatch("cn.myperf4j.config.abc", "*.myperf4j*ac")); Assert.assertFalse(isMatch("cn.myperf4j.config.abc", "a*.myperf4j*ac")); Assert.assertFalse(isMatch("cn.myperf4j.config.abc", "a*.myperf4j.a*")); }