### Question:
JcrSqlQueryParser extends SqlQueryParser { @Override protected String removeBracketsAndQuotes( String text ) { if (text.length() > 0) { char firstChar = text.charAt(0); switch (firstChar) { case '\'': assert text.charAt(text.length() - 1) == firstChar; return removeBracketsAndQuotes(text.substring(1, text.length() - 1)); } } return text; } JcrSqlQueryParser(); @Override String getLanguage(); @SuppressWarnings( "deprecation" )
    static final String LANGUAGE; }### Answer:
@Test public void shouldRemoveBracketsAndQuotes() { assertThat(parser.removeBracketsAndQuotes("string"), is("string")); assertThat(parser.removeBracketsAndQuotes("'string'"), is("string")); assertThat(parser.removeBracketsAndQuotes("word one and two"), is("word one and two")); assertThat(parser.removeBracketsAndQuotes("'word one and two'"), is("word one and two")); }
@Test public void shouldFailToRemoveDoubleQuotesAroundOneWord() { assertThat(parser.removeBracketsAndQuotes("\"string\""), is("\"string\"")); assertThat(parser.removeBracketsAndQuotes("\"string\""), is("\"string\"")); assertThat(parser.removeBracketsAndQuotes("\"word one and two\""), is("\"word one and two\"")); assertThat(parser.removeBracketsAndQuotes("[word one and two]"), is("[word one and two]")); }