CamelCasePattern implements Serializable { protected static boolean isAllUpperCase(final String str) { return StringUtils.isAlpha(str) && StringUtils.trimToEmpty(str).toUpperCase().equals(str); } CamelCasePattern(final String pattern); String getPattern(); @Override String toString(); static boolean isValid(final String pattern);  }
@Test() public void testIsAllUpperCase() { assertFalse(CamelCasePattern.isAllUpperCase("a")); assertFalse(CamelCasePattern.isAllUpperCase("aa")); assertFalse(CamelCasePattern.isAllUpperCase("aAa")); assertTrue(CamelCasePattern.isAllUpperCase("A")); assertTrue(CamelCasePattern.isAllUpperCase("AA")); assertFalse(CamelCasePattern.isAllUpperCase("AaA")); assertFalse(CamelCasePattern.isAllUpperCase("*")); }