@Override public boolean nextBoolean() { if (!hasNext()) throw new NoSuchElementException(); c--; if (mustReturnNull) { mustReturnNull = false; last = n; return key[n]; } final boolean key[] = BooleanOpenHashSet.this.key; for (;;) { if (--pos < 0) { // We are just enumerating elements from the wrapped list. last = Integer.MIN_VALUE; return wrapped.getBoolean(-pos - 1); } if (!((key[pos]) == (false))) return key[last = pos]; } } /**
@Override public void remove() { if (last == -1) throw new IllegalStateException(); if (last == n) { BooleanOpenHashSet.this.containsNull = false; BooleanOpenHashSet.this.key[n] = (false); } else if (pos >= 0) shiftKeys(last); else { // We're removing wrapped entries. BooleanOpenHashSet.this.remove(wrapped.getBoolean(-pos - 1)); last = -1; // Note that we must not decrement size return; } size--; last = -1; // You can no longer remove this entry. if (ASSERTS) checkTable(); } }