### Question:
B2StringUtil { public static String underscoresToCamelCase(String orig, boolean capitalizeFirstLetter) { final int origLen = orig.length(); final StringBuilder builder = new StringBuilder(origLen); boolean capitalize = capitalizeFirstLetter; for (int i=0; i < origLen; i++) { char c = orig.charAt(i); if (c == '_') { capitalize = true; continue; } if (capitalize) { c = Character.toTitleCase(c); capitalize = false; } else { c = Character.toLowerCase(c); } builder.append(c); } return builder.toString(); } B2StringUtil(); static String percentEncode(String s); static String percentDecode(String s); static int decimalSubstringToInt(String s, int startIndex, int endIndex); static boolean decimalNumberInRange(String str, int offset, int length,
                                               int minInclusive, int maxInclusive); static String join(String delimiter, Object[] objects); static byte [] getUtf8Bytes(String str); static String toHexString(byte[] b); static String underscoresToCamelCase(String orig, boolean capitalizeFirstLetter); static boolean startsWithIgnoreCase(String all, String possiblePrefix); static final String UTF8; }### Answer:
@Test public void testUnderscoresToCamelCase() { assertEquals("", B2StringUtil.underscoresToCamelCase("", false)); assertEquals("listFiles", B2StringUtil.underscoresToCamelCase("LIST_FILES", false)); assertEquals("ListFiles", B2StringUtil.underscoresToCamelCase("_LIST_FILES", false)); assertEquals("ListFiles", B2StringUtil.underscoresToCamelCase("LIST_FILES", true)); }