/** * Compares the sessionHandle and token of this object with the other * object. Returns only true, if those are equal in both objects. * * @param otherObject * The other Session object. * @return True, if other is an instance of Token and the session handles * and tokens of both objects are equal. False, otherwise. * @preconditions * @postconditions */ @Override public boolean equals(Object otherObject) { if (this == otherObject) { return true; } else if (!(otherObject instanceof Session)) { return false; } Session other = (Session) otherObject; if (this.sessionHandle != other.sessionHandle) { return false; } return this.token.equals(other.token); }