### Question:
SnakeCaseUtil { static String convert(String s) { return SNAKE_CASE_PATTERN.matcher(s).replaceAll("$1_$2").toLowerCase(); }  static boolean isCompliant(String s);  }### Answer:
@Test public void convertToSnakeCase() throws Exception { assertThat(SnakeCaseUtil.convert("simple"), equalTo("simple")); assertThat(SnakeCaseUtil.convert("already_snake_case"), equalTo("already_snake_case")); assertThat(SnakeCaseUtil.convert("isCamelCase"), equalTo("is_camel_case")); assertThat(SnakeCaseUtil.convert("PascalCase"), equalTo("pascal_case")); }