StringUtils { public static boolean isMatchCamelCase(final String name, final String target) { boolean matched; if (org.apache.commons.lang3.StringUtils.isEmpty(target)) { matched = true; } else { if (hasUpperCase(target)) { Pattern pattern = fromCacheOrCompile(target); if (isNull(pattern)) { matched = name.contains(target); } else { matched = matchAndUpdateCache(pattern, name); } } else { matched = matchWhenAllLowerCaseLetters(name, target); } } return matched; }  static String replace(final String string, final String target, final String replacement); static boolean contains(final String name, final String target); static boolean isMatchCamelCase(final String name, final String target); static String getChecksum(final String s); static String escapeJava(final String s);  }
@Test public void testIsMatchCamelCase() { assertTrue(StringUtils.isMatchCamelCase("HashMap", "H")); assertTrue(StringUtils.isMatchCamelCase("charAt", "cA")); assertFalse(StringUtils.isMatchCamelCase("codePointAt", "cA")); assertTrue(StringUtils.isMatchCamelCase("codePointAt", "codPoA")); assertTrue(StringUtils.isMatchCamelCase("contains", "con")); assertFalse(StringUtils.isMatchCamelCase("istrue", "iT")); assertTrue(StringUtils.isMatchCamelCase("isTrue", "isT")); assertTrue(StringUtils.isMatchCamelCase("aVeryLongMethodName", "aVLM")); assertTrue(StringUtils.isMatchCamelCase("aVeryLongMethodName", "aVLMN")); assertTrue(StringUtils.isMatchCamelCase("averylongmethodnameonlylowercase", "averyl")); assertTrue(StringUtils.isMatchCamelCase("charAt", "")); assertTrue(StringUtils.isMatchCamelCase("acceptJsonFormatterVisitor", "aJFV")); assertTrue(StringUtils.isMatchCamelCase("saveOperationChannel", "sOpC")); assertTrue(StringUtils.isMatchCamelCase("CHARAT", "")); assertTrue(StringUtils.isMatchCamelCase("acceptCase", "a")); assertFalse(StringUtils.isMatchCamelCase("StringUtils", "sU")); assertTrue(StringUtils.isMatchCamelCase("StringUtils", "SU")); assertFalse(StringUtils.isMatchCamelCase("AbstractConsumerConnection", "SU")); assertTrue(StringUtils.isMatchCamelCase("appendCodePoint", "aC")); }