@Test
public void testReadSomeZeros() throws IOException {

  final byte[] b = new byte[] {1, 1, 1, 1, 1};
  final int zeros = 2;
  final ReadableByteChannel channel = create(b, zeros);
  final ByteBuffer buffer = ByteBuffer.allocate(7);
  buffer.limit(buffer.capacity() - 1);
  assertEquals(b.length, channel.read(buffer));
  assertEquals(zeros - 1, channel.read(buffer));
  assertArrayEquals(copyOf(b, buffer.capacity()), buffer.array());
  buffer.limit(buffer.capacity());
  assertEquals(1, channel.read(buffer));
  assertArrayEquals(copyOf(b, buffer.capacity()), buffer.array());
  buffer.flip();
  assertEquals(-1, channel.read(buffer));
}