@Test
public void testFlush() throws Exception {

  final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
  final JBBPOut out = BeginBin(buffer);
  out.Bit(true);
  assertEquals(0, buffer.size());
  out.Flush();
  assertEquals(1, buffer.size());
}