StringHelper { public static String deCamelCase(String s){ Pattern p = Pattern.compile("([a-z])([A-Z])"); Matcher m = p.matcher(s); while (m.find()) s = s.replaceFirst(m.group(0), m.group(1) + " " + m.group(2).toLowerCase()); return StringUtils.capitalize(s); }  static String trimAndRemoveExtraSpacesBetweenWords(String sParam); static String removeExtraSpacesAndCapOnlyFirstLetterOfEachWord(String sParam); static String removeExtraSpacesAndCapFirstLetter(String sParam); static String getLoginFromFormattedNameAndLogin(String formattedNameAndLogin); static boolean isStringAValidEmailAddress(String s); static Integer convertStringToInteger(String s); static String toCamelCase(String s); static String deCamelCase(String s);  }
@Test (groups = "unit-tests") public void testDeCamelCase() { String expected = new String("Foo bar baz bob"); Assert.assertEquals(StringHelper.deCamelCase("fooBarBazBob"), expected); }