### Question:
IndexCreator { protected static boolean validFieldName(String fieldName) { String[] parts = fieldName.split("\\."); for (String part: parts) { if (part.startsWith("$")) { String msg = String.format("Field names cannot start with a $ in field %s", part); logger.log(Level.SEVERE, msg); return false; } } return true; } IndexCreator(Database database, SQLDatabaseQueue queue);   }### Answer:
@Test public void validateFieldNames() { assertThat(IndexCreator.validFieldName("name"), is(true)); assertThat(IndexCreator.validFieldName("name.first"), is(true)); assertThat(IndexCreator.validFieldName("name.first.prefix"), is(true)); assertThat(IndexCreator.validFieldName("na$me"), is(true)); assertThat(IndexCreator.validFieldName("name.fir$t"), is(true)); assertThat(IndexCreator.validFieldName("name.fir$t.pref$x"), is(true)); assertThat(IndexCreator.validFieldName("$name"), is(false)); assertThat(IndexCreator.validFieldName("name.$first"), is(false)); assertThat(IndexCreator.validFieldName("name.$first.$prefix"), is(false)); assertThat(IndexCreator.validFieldName("name.first.$prefix"), is(false)); assertThat(IndexCreator.validFieldName("name.first.$pr$efix"), is(false)); assertThat(IndexCreator.validFieldName("name.$$$$.prefix"), is(false)); }