RankedBitVectorImpl implements RankedBitVector, Iterable<Boolean> { @Override public boolean addBit(boolean bit) { boolean ret = this.bitVector.addBit(bit); notifyObservers(); return ret; } 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 testEqualityAndCopyConstructor() { final long aLargeNumber = 0x100000; RankedBitVectorImpl bv0 = new RankedBitVectorImpl(); RankedBitVectorImpl bv1 = new RankedBitVectorImpl(); PseudorandomBooleanGenerator generator = new PseudorandomBooleanGenerator( 0x1234); for (int i = 0; i < aLargeNumber; i++) { boolean value = generator.getPseudorandomBoolean(); bv0.addBit(value); bv1.addBit(value); } assertEqualsForBitVector(bv0, bv1); RankedBitVectorImpl bv2 = new RankedBitVectorImpl(bv1); assertEqualsForBitVector(bv0, bv2); }