@Test public void testIsOnlyFirstUpperCase() { String firstUpperCase1 = "M"; String firstUpperCase2 = "Mama"; String notUpperCase = "aM"; String moreUpperCase = "MM"; String notWord = "Wombat1"; assertTrue(TextUtils.isOnlyFirstUpperCase(firstUpperCase1)); assertTrue(TextUtils.isOnlyFirstUpperCase(firstUpperCase2)); assertFalse(TextUtils.isOnlyFirstUpperCase(notUpperCase)); assertFalse(TextUtils.isOnlyFirstUpperCase(moreUpperCase)); assertFalse(TextUtils.isOnlyFirstUpperCase(notWord)); }
public static boolean isOnlyFirstUpperCase(String text) { boolean firstUpperCase = !NOT_UPPERCASE_PATTERN.matcher(text.substring(0, 1)).find(); boolean restLowerCase = !NOT_LOWERCASE_PATTERN.matcher(text.substring(1)).find(); return firstUpperCase && restLowerCase; }
TextUtils { public static boolean isOnlyFirstUpperCase(String text) { boolean firstUpperCase = !NOT_UPPERCASE_PATTERN.matcher(text.substring(0, 1)).find(); boolean restLowerCase = !NOT_LOWERCASE_PATTERN.matcher(text.substring(1)).find(); return firstUpperCase && restLowerCase; } }
TextUtils { public static boolean isOnlyFirstUpperCase(String text) { boolean firstUpperCase = !NOT_UPPERCASE_PATTERN.matcher(text.substring(0, 1)).find(); boolean restLowerCase = !NOT_LOWERCASE_PATTERN.matcher(text.substring(1)).find(); return firstUpperCase && restLowerCase; }  }
TextUtils { public static boolean isOnlyFirstUpperCase(String text) { boolean firstUpperCase = !NOT_UPPERCASE_PATTERN.matcher(text.substring(0, 1)).find(); boolean restLowerCase = !NOT_LOWERCASE_PATTERN.matcher(text.substring(1)).find(); return firstUpperCase && restLowerCase; }  static boolean isNumberBetween(String s, int lower, int upper); static String removeOrphantSpaces(String text); static String cleanLigatures(String str); static List<String> tokenize(String text); static int tokLen(String text); static String joinStrings(List<String> strings); static String joinStrings(List<String> strings, char delim); static String joinStrings(String[] strings); static List<String> produceDates(List<String> date); static String getTrueVizPath(String pdfPath); static String getNLMPath(String pdfPath); static boolean isWord(String text); static boolean isNumber(String text); static boolean isOnlyFirstUpperCase(String text); static boolean isAllUpperCase(String text); static boolean isAllLowerCase(String text); static boolean isSeparator(String text); static boolean isNonAlphanumSep(String text); }
TextUtils { public static boolean isOnlyFirstUpperCase(String text) { boolean firstUpperCase = !NOT_UPPERCASE_PATTERN.matcher(text.substring(0, 1)).find(); boolean restLowerCase = !NOT_LOWERCASE_PATTERN.matcher(text.substring(1)).find(); return firstUpperCase && restLowerCase; }  static boolean isNumberBetween(String s, int lower, int upper); static String removeOrphantSpaces(String text); static String cleanLigatures(String str); static List<String> tokenize(String text); static int tokLen(String text); static String joinStrings(List<String> strings); static String joinStrings(List<String> strings, char delim); static String joinStrings(String[] strings); static List<String> produceDates(List<String> date); static String getTrueVizPath(String pdfPath); static String getNLMPath(String pdfPath); static boolean isWord(String text); static boolean isNumber(String text); static boolean isOnlyFirstUpperCase(String text); static boolean isAllUpperCase(String text); static boolean isAllLowerCase(String text); static boolean isSeparator(String text); static boolean isNonAlphanumSep(String text);  }