Utils { public static String unCamelify(CharSequence original) { StringBuilder result = new StringBuilder(original.length()); boolean wasLowercase = false; for (int i = 0; i < original.length(); i++) { char ch = original.charAt(i); if (Character.isUpperCase(ch) && wasLowercase) { result.append('-'); } wasLowercase = Character.isLowerCase(ch); result.append(Character.toLowerCase(ch)); } return result.toString(); }  static String unCamelify(CharSequence original); static MethodParameter createMethodParameter(Parameter parameter); static MethodParameter createMethodParameter(Executable executable, int i); static Stream<MethodParameter> createMethodParameters(Executable executable);  }
@Test public void testUnCamelify() throws Exception { assertThat(Utils.unCamelify("HelloWorld")).isEqualTo("hello-world"); assertThat(Utils.unCamelify("helloWorld")).isEqualTo("hello-world"); assertThat(Utils.unCamelify("helloWorldHowAreYou")).isEqualTo("hello-world-how-are-you"); assertThat(Utils.unCamelify("URL")).isEqualTo("url"); }