@Test
public void testParse_outOfOrderTokens() {

  List<Token> listTokens = new ArrayList<Token>();
  listTokens.add(new Token(Token.TYPE.RELATIONAL_OPERATOR, "="));
  listTokens.add(new Token(Token.TYPE.PROPERTY_OPERAND, "a"));
  listTokens.add(new Token(Token.TYPE.VALUE_OPERAND, "1"));
  // should be a logical operator
  listTokens.add(new Token(Token.TYPE.RELATIONAL_OPERATOR, "="));
  try {
    new QueryParser().parse(listTokens.toArray(new Token[listTokens.size()]));
    fail("Expected InvalidQueryException due to invalid last token");
  } catch (InvalidQueryException e) {
    // expected
  }
}