@Test
public void testWrite() throws Exception {

	ByteArrayOutputStream byteArrayOutputStream =
		new ByteArrayOutputStream();
	UnsyncBufferedOutputStream unsyncBufferedOutputStream =
		new UnsyncBufferedOutputStream(byteArrayOutputStream, _SIZE * 2);
	byte[] buffer = (byte[])_bufferField.get(unsyncBufferedOutputStream);
	Assert.assertEquals(Arrays.toString(buffer), _SIZE * 2, buffer.length);
	for (int i = 0; i < _SIZE; i++) {
		unsyncBufferedOutputStream.write(i);
		Assert.assertEquals(i, buffer[i]);
	}
	unsyncBufferedOutputStream.flush();
	Assert.assertTrue(
		Arrays.equals(_BUFFER, byteArrayOutputStream.toByteArray()));
}