@Test
public void testRead() throws IOException {

  EventLogHttpTransferListener listener = new EventLogHttpTransferListener();
  ReadableByteChannel channel = Channels.newChannel(new ByteArrayInputStream(new byte[3]));
  @SuppressWarnings("resource")
  ReadableByteChannel in = new ObservableRedableByteChannel(channel, listener);
  ByteBuffer dst = ByteBuffer.allocate(4);
  dst.limit(1);
  assertEquals(1, in.read(dst));
  dst.limit(4);
  assertEquals(2, in.read(dst));
  assertEquals(-1, in.read(dst));
  assertEquals(of(new Transferred(1), new Transferred(2)), listener.getEventLog());
}