### Question:
SqlQueryParser implements QueryParser { protected Operator parseComparisonOperator( TokenStream tokens ) { if (tokens.canConsume("=")) return Operator.EQUAL_TO; if (tokens.canConsume("LIKE")) return Operator.LIKE; if (tokens.canConsume("!", "=")) return Operator.NOT_EQUAL_TO; if (tokens.canConsume("<", ">")) return Operator.NOT_EQUAL_TO; if (tokens.canConsume("<", "=")) return Operator.LESS_THAN_OR_EQUAL_TO; if (tokens.canConsume(">", "=")) return Operator.GREATER_THAN_OR_EQUAL_TO; if (tokens.canConsume("<")) return Operator.LESS_THAN; if (tokens.canConsume(">")) return Operator.GREATER_THAN; Position pos = tokens.nextPosition(); String msg = GraphI18n.expectingComparisonOperator.text(tokens.consume(), pos.getLine(), pos.getColumn()); throw new ParsingException(pos, msg); }  String getLanguage(); @Override String toString(); @Override boolean equals( Object obj ); QueryCommand parseQuery( String query,
                                    TypeSystem typeSystem ); static final String LANGUAGE; }### Answer:
@Test public void shouldParseComparisonOperator() { for (Operator operator : Operator.values()) { assertThat(parser.parseComparisonOperator(tokens(operator.symbol())), is(operator)); } for (Operator operator : Operator.values()) { assertThat(parser.parseComparisonOperator(tokens(operator.symbol().toUpperCase())), is(operator)); } for (Operator operator : Operator.values()) { assertThat(parser.parseComparisonOperator(tokens(operator.symbol().toLowerCase())), is(operator)); } }
@Test( expected = ParsingException.class ) public void shouldFailToParseComparisonOperatorIfOperatorIsUnknown() { parser.parseComparisonOperator(tokens("FOO")); }