@Override
    public boolean equals(Object object) {
        if (object == null) {
            return false;
        }
        if (getClass() != object.getClass()) {
            return false;
        }
        Pair<?, ?> other = (Pair<?, ?>) object;
        if (key != other.key && (key == null || !key.equals(other.key))) {
            return false;
        }
        return true;
    }