@Test
  public void readAndWriteCornerCasesTest() throws Exception {
    // 0 sized blob.
    ByteBufferReadableStreamChannel readableStreamChannel = new ByteBufferReadableStreamChannel(ByteBuffer.allocate(0));
    assertTrue("ByteBufferReadableStreamChannel is not open", readableStreamChannel.isOpen());
    assertEquals("Size returned by ByteBufferReadableStreamChannel is not 0", 0, readableStreamChannel.getSize());
    ByteBufferAsyncWritableChannel writeChannel = new ByteBufferAsyncWritableChannel();
    ReadIntoCallback callback = new ReadIntoCallback();
    Future<Long> future = readableStreamChannel.readInto(writeChannel, callback);
    ByteBuffer chunk = writeChannel.getNextChunk(0);
    while (chunk != null) {
      writeChannel.resolveOldestChunk(null);
      chunk = writeChannel.getNextChunk(0);
    }
    callback.awaitCallback();
    assertEquals("There should have no bytes to read (future)", 0, future.get().longValue());
    assertEquals("There should have no bytes to read (callback)", 0, callback.bytesRead);
    if (callback.exception != null) {
      throw callback.exception;
    }
    writeChannel.close();
    readableStreamChannel.close();
  }
Tests behavior of read operations on some corner cases.
<p/>
Corner case list:
1. Blob size is 0.
@throws Exception
ambry-commons/src/test/java/com/github/ambry/commons/ByteBufferReadableStreamChannelTest.java