StrictBitVector implements BitVector { @Override public void xor(BitVector other) { ByteArrayHelper.xor(bits, other.toByteArray()); } 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 testXor() { byte[] bitsOne = { (byte) 0x00, (byte) 0x01, (byte) 0x02 }; StrictBitVector bvOne = new StrictBitVector(bitsOne); byte[] bitsTwo = { (byte) 0x03, (byte) 0x04, (byte) 0x05 }; StrictBitVector bvTwo = new StrictBitVector(bitsTwo); bvOne.xor(bvTwo); byte[] expectedBytes = { (byte) 0x03, (byte) 0x05, (byte) 0x07 }; StrictBitVector expected = new StrictBitVector(expectedBytes); assertEquals(expected, bvOne); }