public Set<String> validate(String expr, Set<String> whitelistVars) throws Exception {
    checkExprLength(expr);
    selParser.ReInit(new ByteArrayInputStream(expr.getBytes()));
    ASTExecute n = selParser.Execute();
    Map<String, Boolean> vars = new HashMap<>();
    n.jjtAccept(validator, vars);

    Set<String> res = new HashSet<>();
    for (Map.Entry<String, Boolean> entry : vars.entrySet()) {
      if (entry.getValue() && !whitelistVars.contains(entry.getKey())) {
        res.add(entry.getKey());
      }
    }
    return res;
  }
@Test
  public void testValidate() throws Exception {
    Set<String> res = t1.validate("x.length;", new HashSet<>());
    assertEquals("[x]", res.toString());
  }