@Test
public void testTokens_multipleBrackets() throws InvalidQueryException {

  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"));
  listTokens.add(new Token(Token.TYPE.LOGICAL_OPERATOR, "&"));
  listTokens.add(new Token(Token.TYPE.BRACKET_OPEN, "("));
  listTokens.add(new Token(Token.TYPE.RELATIONAL_OPERATOR, "<="));
  listTokens.add(new Token(Token.TYPE.PROPERTY_OPERAND, "b"));
  listTokens.add(new Token(Token.TYPE.VALUE_OPERAND, "2"));
  listTokens.add(new Token(Token.TYPE.LOGICAL_OPERATOR, "&"));
  listTokens.add(new Token(Token.TYPE.BRACKET_OPEN, "("));
  listTokens.add(new Token(Token.TYPE.RELATIONAL_OPERATOR, ">="));
  listTokens.add(new Token(Token.TYPE.PROPERTY_OPERAND, "c"));
  listTokens.add(new Token(Token.TYPE.VALUE_OPERAND, "3"));
  listTokens.add(new Token(Token.TYPE.LOGICAL_OPERATOR, "|"));
  listTokens.add(new Token(Token.TYPE.RELATIONAL_OPERATOR, "!="));
  listTokens.add(new Token(Token.TYPE.PROPERTY_OPERAND, "d"));
  listTokens.add(new Token(Token.TYPE.VALUE_OPERAND, "4"));
  listTokens.add(new Token(Token.TYPE.BRACKET_CLOSE, ")"));
  listTokens.add(new Token(Token.TYPE.BRACKET_CLOSE, ")"));
  QueryLexer lexer = new QueryLexer();
  Token[] tokens = lexer.tokens("a<1&(b<=2&(c>=3|d!=4))");
  assertArrayEquals(listTokens.toArray(new Token[listTokens.size()]), tokens);
}