### Question:
SqlQueryParser implements QueryParser { protected Term parseFullTextSearchExpression( String expression, Position startOfExpression ) { try { return new FullTextSearchParser().parse(expression); } catch (ParsingException e) { Position queryPos = startOfExpression.add(e.getPosition()); throw new ParsingException(queryPos, e.getMessage()); } }  String getLanguage(); @Override String toString(); @Override boolean equals( Object obj ); QueryCommand parseQuery( String query,
                                    TypeSystem typeSystem ); static final String LANGUAGE; }### Answer:
@Test public void shouldParseFullTextSearchExpressionFromStringWithValidExpression() { Position pos = new Position(500, 100, 13); FullTextSearch.Term result = parser.parseFullTextSearchExpression("term1 term2 OR -term3 OR -term4 OR term5", pos); assertThat(result, is(notNullValue())); assertThat(result, is(instanceOf(Disjunction.class))); Disjunction disjunction = (Disjunction)result; assertThat(disjunction.getTerms().size(), is(4)); Conjunction conjunction1 = (Conjunction)disjunction.getTerms().get(0); Term term3 = disjunction.getTerms().get(1); Term term4 = disjunction.getTerms().get(2); Term term5 = disjunction.getTerms().get(3); FullTextSearchParserTest.assertHasSimpleTerms(conjunction1, "term1", "term2"); FullTextSearchParserTest.assertSimpleTerm(term3, "term3", true, false); FullTextSearchParserTest.assertSimpleTerm(term4, "term4", true, false); FullTextSearchParserTest.assertSimpleTerm(term5, "term5", false, false); }
@Test public void shouldConvertPositionWhenUnableToParseFullTextSearchExpression() { try { parser.parseFullTextSearchExpression("", new Position(500, 100, 13)); fail("Should have thrown an exception"); } catch (ParsingException e) { assertThat(e.getPosition().getLine(), is(100)); assertThat(e.getPosition().getColumn(), is(13)); assertThat(e.getPosition().getIndexInContent(), is(500)); } }