@Override public void remove() { if (last == -1) throw new IllegalStateException(); if (last == n) { LongOpenCustomHashSet.this.containsNull = false; LongOpenCustomHashSet.this.key[n] = (0); } else if (pos >= 0) shiftKeys(last); else { // We're removing wrapped entries. LongOpenCustomHashSet.this.remove(wrapped.getLong(-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(); } }