BoundedBitChannel implements BitChannel { public int getRelativeBitPos() { return channel.getRelativeBitPos(); } BoundedBitChannel(@Nonnull BitChannel channel, @Nonnegative long maxBits); void write(boolean value); void write(int nrbits, byte value); void write(int nrbits, int value, ByteOrder byteOrder); void write(int nrbits, long value, ByteOrder byteOrder); void write(int nrbits, short value, ByteOrder byteOrder); void write(byte[] src, int offset, int length); long write(ByteBuffer buffer); int getRelativeBitPos(); void close();  }
@Test public void shouldReportRelativeBitPosCorrectly() throws IOException { when(channel.getRelativeBitPos()).thenReturn(4); assertThat(boundedChannel.getRelativeBitPos(), is(4)); verify(channel).getRelativeBitPos(); }