@Override
    public boolean equals(Object other) {
      if (this == other) {
        return true;
      }
      if (!(other instanceof Token)) {
        return false;
      }
      Token token = (Token) other;
      return type.equals(token.type) && lexeme.equals(token.lexeme) && position == token.position;
    }