@Override
    public boolean equals(Object o) {
        if (!(o instanceof CustomSortedSet)) {
            return false;
        }
        CustomSortedSet other = (CustomSortedSet) o;
        if (this.size() != other.size()) {
            return false;
        }
        for (int i = 0; i < this.size(); i++) {
            if (!(this.elements[i].equals(other.elements[i]))) {
                return false;
            }
        }
        return true;
    }