@Test
public void testWriteBoolean() throws Exception {

	Serializer serializer = new Serializer();
	boolean[] booleans = new boolean[_COUNT];
	for (int i = 0; i < _COUNT; i++) {
		booleans[i] = _random.nextBoolean();
		serializer.writeBoolean(booleans[i]);
	}
	ByteBuffer byteBuffer = serializer.toByteBuffer();
	byte[] bytes = byteBuffer.array();
	Assert.assertNull(_bufferField.get(serializer));
	for (int i = 0; i < _COUNT; i++) {
		if (booleans[i]) {
			Assert.assertEquals(1, bytes[i]);
		}
		else {
			Assert.assertEquals(0, bytes[i]);
		}
	}
}