@Test
public void testWriteBit_ErrorForNegativeSize() throws Exception {

  assertThrows(IllegalArgumentException.class, () -> new JBBPBitOutputStream(new ByteArrayOutputStream()).writeBits(4, JBBPBitNumber.decode(-1)));
}