### Question:
NamingConventions { public static ImmutableList<String> splitToLowercaseTerms(String identifierName) { if (ONLY_UNDERSCORES.matcher(identifierName).matches()) { return ImmutableList.of(identifierName); } return Arrays.stream(TERM_SPLITTER.split(identifierName)) .map(String::toLowerCase) .collect(toImmutableList()); }  static ImmutableList<String> splitToLowercaseTerms(String identifierName); static String convertToLowerUnderscore(String identifierName);  }### Answer:
@Test public void splitToLowercaseTerms_separatesTerms_withLowerCamelCase() { String identifierName = "camelCaseTerm"; ImmutableList<String> terms = NamingConventions.splitToLowercaseTerms(identifierName); assertThat(terms).containsExactly("camel", "case", "term"); }
@Test public void splitToLowercaseTerms_separatesTerms_withUpperCamelCase() { String identifierName = "CamelCaseTerm"; ImmutableList<String> terms = NamingConventions.splitToLowercaseTerms(identifierName); assertThat(terms).containsExactly("camel", "case", "term"); }
@Test public void splitToLowercaseTerms_separatesTrailingDigits_withoutDelimiter() { String identifierName = "term123"; ImmutableList<String> terms = NamingConventions.splitToLowercaseTerms(identifierName); assertThat(terms).containsExactly("term", "123"); }
@Test public void splitToLowercaseTerms_doesntSplit_withIntermediateDigits() { String identifierName = "i8n"; ImmutableList<String> terms = NamingConventions.splitToLowercaseTerms(identifierName); assertThat(terms).containsExactly("i8n"); }
@Test public void splitToLowercaseTerms_separatesTerms_withUnderscoreSeparator() { String identifierName = "UNDERSCORE_SEPARATED"; ImmutableList<String> terms = NamingConventions.splitToLowercaseTerms(identifierName); assertThat(terms).containsExactly("underscore", "separated"); }
@Test public void splitToLowercaseTerms_findsSingleTerm_withOnlyUnderscore() { String identifierName = "_____"; ImmutableList<String> terms = NamingConventions.splitToLowercaseTerms(identifierName); assertThat(terms).containsExactly("_____"); }
@Test public void splitToLowercaseTerms_noEmptyTerm_withTrailingUnderscoreDigit() { String identifierName = "test_1"; ImmutableList<String> terms = NamingConventions.splitToLowercaseTerms(identifierName); assertThat(terms).containsExactly("test", "1"); }