StringUtils { public static String capitalize(String s) { if (s == null || s.length() == 0) { return ""; } char first = s.charAt(0); if (Character.isUpperCase(first)) { return s; } else { return Character.toUpperCase(first) + s.substring(1); } } private  StringUtils(); static String capitalize(String s);  }
@Test public void shouldReturnEmptyStringWithNullString() { String actual = StringUtils.capitalize(null); String expected = ""; assertEquals(expected, actual); }
@Test public void shouldCapitalizeGivenText() { String actual = StringUtils.capitalize("hello world"); String expected = "Hello world"; assertEquals(expected, actual); }