### Question:
StringUtils { public static String convertToCamelCase(String string) { String txt = clean(string); if (isEmpty(txt)) { throw new IllegalArgumentException("string is empty"); } StringBuilder sb = new StringBuilder(); for (int i = 0; i < txt.length(); i++) { char c = txt.charAt(i); if (isAlpha(c)) { if (i == 0) { sb.append(c); } else if (!isAlpha(txt.charAt(i - 1))) { sb.append(Character.toUpperCase(c)); } else if (Character.isLowerCase(c) || (Character.isUpperCase(c) && Character.isLowerCase(txt.charAt(i - 1)))) { sb.append(c); } else { sb.append(Character.toLowerCase(c)); } } } String convertedTxt = sb.toString(); if (convertedTxt.isEmpty()) { return txt; } return Introspector.decapitalize(convertedTxt); } StringUtils(); static boolean isEmpty(String string); static String clean(String string); static boolean isAlpha(Character c); static String getBeanName(String queueName); static String convertToCamelCase(String string); static String groupName(String name);  }### Answer:
@Test public void convertToCamelCaseEmpty() { assertThrows(IllegalArgumentException.class, () -> StringUtils.convertToCamelCase(" ")); }
@Test public void convertToCamelCaseNull() { assertThrows(IllegalArgumentException.class, () -> StringUtils.convertToCamelCase(null)); }
@Test public void convertToCamelCase() { assertEquals("url", StringUtils.convertToCamelCase("URL")); assertEquals("jobQueue", StringUtils.convertToCamelCase("job-Queue")); assertEquals("jobQueue", StringUtils.convertToCamelCase("Job-Queue")); assertEquals("jobQueue", StringUtils.convertToCamelCase("JOB-Queue")); assertEquals("jobQueue", StringUtils.convertToCamelCase(" JOB-Queue ")); assertEquals("jobQueue", StringUtils.convertToCamelCase(" JOB-1233-Queue ")); assertEquals("jobQuEue", StringUtils.convertToCamelCase(" JOB-1233-Qu1234eue ")); assertEquals("jobQuEueQueue", StringUtils.convertToCamelCase(" JOB-1233-Qu1234eueQUEUE ")); assertEquals("1234-1234", StringUtils.convertToCamelCase(" 1234-1234 ")); assertEquals("jB", StringUtils.convertToCamelCase(" jB ")); assertEquals("jOb", StringUtils.convertToCamelCase(" jOB ")); }