LongArrayBitSet implements ArrayBitSet { @Override public boolean inverse() { boolean notEmpty = false; final int last = usedWords - 1; for (int i = 0; i < last; i++) { words[i] = ~words[i]; if (words[i] != 0) notEmpty = true; } final int shift = size & 0x3f; if (shift == 0) { words[last] = ~words[last]; if (words[last] != 0) { notEmpty = true; } } else { words[last] = ~words[last] & ~(-1L << shift); if (words[last] != 0) { notEmpty = true; } } return notEmpty; } private  LongArrayBitSet(
            final int size,
            @NotNull
            final long[] words); @NotNull static ArrayBitSet zero(final int size); @NotNull static ArrayBitSet one(final int size); @Override int getSize(); @Override int cardinality(); @NotNull @Override long[] toArray(); @Override void set(final int i); @Override boolean get(final int i); void clear(); @Override boolean inverse(); void set(); @Override boolean and(
            @NotNull
            final BitSet set); @Override boolean or(
            @NotNull
            final BitSet set); @Override boolean xor(
            @NotNull
            BitSet set); @Override boolean and(
            @NotNull
            Buffer longArrayBitSetInByteBuffer,
            long startPosition,
            int bitSetSizeInLongs); @Override boolean or(
            @NotNull
            final Buffer longArrayBitSetInByteBuffer,
            final long startPosition,
            final int bitSetSizeInLongs); @Override boolean xor(
            @NotNull
            Buffer longArrayBitSetInByteBuffer,
            long startPosition,
            int bitSetSizeInLongs); @Override boolean isEmpty(); @Override int nextSetBit(final int fromIndexInclusive);  }
@Test public void inverse() { for (int i = 1; i < SIZE; i++) { final BitSet bs = LongArrayBitSet.one(i); assertFalse(bs.inverse()); assertTrue(bs.inverse()); assertEquals(i, bs.cardinality()); } }