code: public boolean isMatched(AnalyzedToken token) {
      if (testWhitespace && !isWhitespaceBefore(token)) {
        return false;
      }
      boolean posNegation = posToken != null && posToken.negation;
      if (testString) {
        return isStringTokenMatched(token) ^ negation &&
               isPosTokenMatched(token) ^ posNegation;
      } else {
        return !negation &&
               isPosTokenMatched(token) ^ posNegation;
      }
    }
docs: Checks whether the rule element matches the token given as a parameter.
  @param token AnalyzedToken to check matching against
  @return True if token matches, false otherwise.