@Test
public void flip() {

	final long seed = Randoms.seed();
	final Random random = new Random(seed);
	final byte[] data = new byte[1000];
	for (int i = 0; i < data.length; ++i) {
		data[i] = (byte)random.nextInt();
	}
	final byte[] cdata = data.clone();
	for (int i = 0; i < data.length*8; ++i) {
		Bits.flip(cdata, i);
	}
	for (int i = 0; i < data.length*8; ++i) {
		Assert.assertEquals(Bits.get(cdata, i), !Bits.get(data, i), "Index: " + i);
	}
}