ReadOnlyZeroBitSet implements BitSet { @Override public int nextSetBit(final int fromIndexInclusive) { assert fromIndexInclusive >= 0; return -1; } ReadOnlyZeroBitSet(final int size); @Override int getSize(); @Override int cardinality(); @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 nextSetBit() { final BitSet bs = new ReadOnlyZeroBitSet(SIZE); for (int i = 0; i < SIZE; i++) { assertEquals(-1, bs.nextSetBit(i)); } assertEquals(-1, bs.nextSetBit(SIZE)); }
@Test(expected = AssertionError.class) public void invalidNextSetBit() { final BitSet bs = new ReadOnlyZeroBitSet(SIZE); bs.nextSetBit(-1); }