StringUtil { public static String toFirstUpper(String optionName) { if (optionName == null || optionName.length() == 0) { return ""; } return optionName.substring(0, 1).toUpperCase() + optionName.substring(1); } private  StringUtil(); static String toFirstUpper(String optionName);  }
@Test public void testToFirstUpper() throws Exception { assertEquals("", StringUtil.toFirstUpper(null)); assertEquals("", StringUtil.toFirstUpper("")); assertEquals("A", StringUtil.toFirstUpper("a")); assertEquals("Ab", StringUtil.toFirstUpper("ab")); }