static void compareContent(byte[] originalContent, ByteRange range, ReadableStreamChannel readableStreamChannel)
      throws ExecutionException, InterruptedException {
    ByteBuffer putContentBuf = ByteBuffer.wrap(originalContent);
    // If a range is set, compare the result against the specified byte range.
    if (range != null) {
      ByteRange resolvedRange = range.toResolvedByteRange(originalContent.length);
      putContentBuf =
          ByteBuffer.wrap(originalContent, (int) resolvedRange.getStartOffset(), (int) resolvedRange.getRangeSize());
    }
    ByteBufferAsyncWritableChannel getChannel = new ByteBufferAsyncWritableChannel();
    Future<Long> readIntoFuture = readableStreamChannel.readInto(getChannel, null);
    final int bytesToRead = putContentBuf.remaining();
    int readBytes = 0;
    do {
      ByteBuffer buf = getChannel.getNextChunk();
      int bufLength = buf.remaining();
      assertTrue("total content read should not be greater than length of put content",
          readBytes + bufLength <= bytesToRead);
      while (buf.hasRemaining()) {
        assertEquals("Get and Put blob content should match", putContentBuf.get(), buf.get());
        readBytes++;
      }
      getChannel.resolveOldestChunk(null);
    } while (readBytes < bytesToRead);
    assertEquals("the returned length in the future should be the length of data written", (long) readBytes,
        (long) readIntoFuture.get());
    assertNull("There should be no more data in the channel", getChannel.getNextChunk(0));
  }
Compare and assert that the content in the given {@link ReadableStreamChannel} is exactly the same as
the original content argument.
@param originalContent the content array to check against.
@param range if non-null, apply this range to {@code originalContent} before comparison.
@param readableStreamChannel the {@link ReadableStreamChannel} that is the candidate for comparison.
ambry-router/src/test/java/com/github/ambry/router/RouterTestHelpers.java