BitReader { public long readableBits() { return (long) byteBuf.readableBytes() * 8 + (currentByte != null ? currentIndex + 1 : 0); } BitReader(ByteBuf byteBuf); boolean testBit(); long readableBits(); void skipBits(int numberOfBits); byte readBit(); long readBits(int numberOfBits); boolean isByteBoundary(); Optional<Long> findStart();  }
@Test public void testReadableBits1() { ByteBuf byteBuf = Unpooled.wrappedBuffer(new byte[] {}); BitReader bitReader = new BitReader(byteBuf); assertThat(bitReader.readableBits(), is(0L)); }