@Test
public void testReadAfterEof() throws Exception {

  byte[] inputData = "The quick brown fox jumps over the lazy dog.".getBytes(UTF_8);
  ReadableByteChannel baseChannel = new ByteBufferChannel(inputData);
  RewindableReadableByteChannel rewindableChannel =
      new RewindableReadableByteChannel(baseChannel);
  ByteBuffer buffer1 = ByteBuffer.allocate(1000);
  assertEquals(inputData.length, rewindableChannel.read(buffer1));
  ByteBuffer buffer2 = ByteBuffer.allocate(10);
  assertEquals(-1, rewindableChannel.read(buffer2));
  assertArrayEquals(Arrays.copyOf(buffer2.array(), buffer2.position()), new byte[]{});
}