@Test
public void shouldDealWithNonAlignedMultipleBytes() throws IOException {

    OutputStreamBitChannel channel = new OutputStreamBitChannel(out);
    channel.write(3, (byte) 0xff); // 111
    channel.write(7, (byte) 0x00); // 0000000
    channel.write(8, (byte) 0xff); // 11111111
    channel.write(6, (byte) 0x00); // 000000
    verify(out).write((byte) Integer.parseInt("11100000", 2));
    verify(out).write((byte) Integer.parseInt("00111111", 2));
    verify(out).write((byte) Integer.parseInt("11000000", 2));
    verifyNoMoreInteractions(out);
}