RankedBitVectorImpl implements RankedBitVector, Iterable<Boolean> { @Override public String toString() { return this.bitVector.toString(); } RankedBitVectorImpl();  RankedBitVectorImpl(BitVector bitVector);  RankedBitVectorImpl(long initialSize);  RankedBitVectorImpl(long initialSize, int countBlockSize,
			int findPositionBlockSize); @Override boolean addBit(boolean bit); @Override long countBits(boolean bit, long position); @Override boolean equals(Object obj); @Override long findPosition(boolean bit, long nOccurrence); @Override boolean getBit(long position); @Override int hashCode(); @Override Iterator<Boolean> iterator(); @Override void setBit(long position, boolean bit); @Override long size(); @Override String toString();  }
@Test public void testToString() { RankedBitVectorImpl bv = new RankedBitVectorImpl(); for (int i = 0; i < 0x10; i++) { boolean value = (i % 3) == 0; bv.addBit(value); } Assert.assertEquals("1001001001001001", bv.toString()); assertCorrectCount(bv); assertCorrectFindPosition(bv); for (int i = 0; i < 0x10; i++) { boolean value = (i % 2) == 0; bv.addBit(value); } Assert.assertEquals("10010010010010011010101010101010", bv.toString()); assertCorrectCount(bv); assertCorrectFindPosition(bv); for (int i = 0; i < 0x20; i++) { bv.setBit(i, bv.getBit(i)); } Assert.assertEquals("10010010010010011010101010101010", bv.toString()); assertCorrectCount(bv); assertCorrectFindPosition(bv); for (int i = 0; i < 0x20; i++) { bv.setBit(i, !bv.getBit(i)); } Assert.assertEquals("01101101101101100101010101010101", bv.toString()); assertCorrectCount(bv); assertCorrectFindPosition(bv); }