public void validateEndState() throws InvalidQueryException {
      for (TokenHandler handler : TOKEN_HANDLERS.get(getLastTokenType())) {
        handler.validateEndState(this);
      }
    }
Validate the end state of the scan context.
Iterates over each handler associated with the final token type and asks it to validate the context.
@throws InvalidQueryException  if the context is determined to in an invalid end state
ambari-server/src/main/java/org/apache/ambari/server/api/predicate/QueryLexer.java