@Override
    public Iterator<E> iterator() {
        return new Iterator<E>() {
            private int index = -1;

            @Override
            public boolean hasNext() {
                return index < SimpleHashSet.this.size() - 1;
            }

            @Override
            public E next() {
                ++index;
                for(int j = 0; j < SIZE; j++) {
                    if((start(j) <= index) && (index < end(j))) {
                        return buckets[j].get(index - start(j));
                    }
                }
                return null;
            }

            @Override
            public void remove() {
                for(int j = 0; j < SIZE; j++) {
                    if(start(j) <= index && index < end(j)) {
                        buckets[j].remove(index - start(j));
                    }
                }
                index--;
            }
        };
    }