@Override
    public SortedSet<T> subSet(T fromElement, T toElement) {
        int size = this.size();
        ArrayList subset = new ArrayList(size);
        boolean capture = false;
        boolean finished = false;
        if (this.contains(fromElement) && this.contains(toElement)) {
            while (!finished) {
                for (int i = 0; i < size; i++) {
                    Object current = elements[i];
                    if (current.equals(fromElement)) {
                        capture = true;
                    }
                    if (current.equals(toElement)) {
                        capture = false;
                        finished = true;
                    }
                    if (capture) {
                        subset.add(current);
                    }
                }
            }
        }
        return new CustomSortedSet((T[]) subset.toArray());
    }