CaseUtil { public static boolean isInitialUppercase(String word) { return isInitialUppercase(word, Locale.getDefault()); }  static boolean isInitialUppercase(String word); static boolean isInitialUppercase(String word, Locale locale); static boolean isAllUppercase(String word); static boolean isAllUppercase(String word, Locale locale);  }
@Test public void testIsInitialUppercase() throws Exception { assertTrue(CaseUtil.isInitialUppercase("Orange", Locale.US)); assertFalse(CaseUtil.isInitialUppercase("O", Locale.US)); assertFalse(CaseUtil.isInitialUppercase("o", Locale.US)); assertFalse(CaseUtil.isInitialUppercase("orange", Locale.US)); assertTrue(CaseUtil.isInitialUppercase("Or", Locale.US)); assertFalse(CaseUtil.isInitialUppercase("ORANGE", Locale.US)); assertFalse(CaseUtil.isInitialUppercase("OrangE", Locale.US)); assertFalse(CaseUtil.isInitialUppercase("oRANGE", Locale.US)); assertFalse(CaseUtil.isInitialUppercase("1asdf", Locale.US)); assertFalse(CaseUtil.isInitialUppercase("A1", Locale.US)); assertTrue(CaseUtil.isInitialUppercase("A1asdf", Locale.US)); assertFalse(CaseUtil.isInitialUppercase("A1234", Locale.US)); assertTrue(CaseUtil.isInitialUppercase("A1234a", Locale.US)); }