StrictBitVector implements BitVector { public String asBinaryString() { String binStr = ""; for (int b = 0; b < size; b++) { binStr += getBit(b) ? "1" : "0"; } return binStr; } StrictBitVector(byte[] bits);  StrictBitVector(int size);  StrictBitVector(int size, Drbg rand); boolean getBit(int index, boolean isBigEndian); @Override boolean getBit(int bit); void setBit(int index, boolean value, boolean isBigEndian); @Override void setBit(int index, boolean value); @Override int getSize(); @Override byte[] toByteArray(); String asBinaryString(); @Override void xor(BitVector other); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); static StrictBitVector concat(StrictBitVector... bitVectors);  }
@Test public void testAsBinaryString() { int bitLen = 72; byte[] bits = new byte[bitLen / 8]; for (int b = 0; b < bits.length; b++) { bits[b] = (byte) b; } StrictBitVector bv = new StrictBitVector(bits); String expected = "000100001110000001100000101000000010000011000000010000001000000000000000"; assertEquals(expected, bv.asBinaryString()); }