code: public static boolean isVariable(ASTNode expression, String pattern) {
          return (expression instanceof VariableExpression && ((VariableExpression) expression).getName().matches(pattern));
      }
docs: Tells you if the given ASTNode is a VariableExpression with the given name.
  @param expression
  any AST Node
  @param pattern
  a string pattern to match
  @return
  true if the node is a variable with the specified name