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