public static boolean needsQuotes(final String identifier) {
    return !(isValid(identifier) && upperCase(identifier));
  }
@Test
  public void shouldNeedBackQuotes() {
    // Given:
    final String[] identifiers = new String[]{
        "SELECT",   // reserved word
        "@ID",      // invalid character
        "FOO.BAR",  // with a dot
        "foo"       // lower case
    };

    // Then:
    for (final String identifier : identifiers) {
      assertThat("Expected quotes for " + identifier, IdentifierUtil.needsQuotes(identifier));
    }
  }