private void testRangeRequestSimpleBlob(boolean resolveRangeOnEmptyBlob) throws Exception {
    // Random valid ranges
    for (int i = 0; i < 5; i++) {
      blobSize = random.nextInt(maxChunkSize) + 1;
      int randomOne = random.nextInt(blobSize);
      int randomTwo = random.nextInt(blobSize);
      testRangeRequest(ByteRanges.fromOffsetRange(Math.min(randomOne, randomTwo), Math.max(randomOne, randomTwo)),
          resolveRangeOnEmptyBlob, true);
    }
    blobSize = random.nextInt(maxChunkSize) + 1;
    // Entire blob
    testRangeRequest(ByteRanges.fromOffsetRange(0, blobSize - 1), resolveRangeOnEmptyBlob, true);
    // Range that extends to end of blob
    testRangeRequest(ByteRanges.fromStartOffset(random.nextInt(blobSize)), resolveRangeOnEmptyBlob, true);
    // Last n bytes of the blob
    testRangeRequest(ByteRanges.fromLastNBytes(random.nextInt(blobSize) + 1), resolveRangeOnEmptyBlob, true);
    // Last blobSize + 1 bytes
    testRangeRequest(ByteRanges.fromLastNBytes(blobSize + 1), resolveRangeOnEmptyBlob, true);
    // Range over the end of the blob
    testRangeRequest(ByteRanges.fromOffsetRange(random.nextInt(blobSize), blobSize + 5), resolveRangeOnEmptyBlob, true);
    // Ranges that start past the end of the blob (should not succeed)
    testRangeRequest(ByteRanges.fromStartOffset(blobSize), resolveRangeOnEmptyBlob, false);
    testRangeRequest(ByteRanges.fromOffsetRange(blobSize, blobSize + 20), resolveRangeOnEmptyBlob, false);
    // 0 byte range
    testRangeRequest(ByteRanges.fromLastNBytes(0), resolveRangeOnEmptyBlob, true);
    // 1 byte ranges
    testRangeRequest(ByteRanges.fromOffsetRange(0, 0), resolveRangeOnEmptyBlob, true);
    testRangeRequest(ByteRanges.fromOffsetRange(blobSize - 1, blobSize - 1), resolveRangeOnEmptyBlob, true);
    testRangeRequest(ByteRanges.fromStartOffset(blobSize - 1), resolveRangeOnEmptyBlob, true);
    testRangeRequest(ByteRanges.fromLastNBytes(1), resolveRangeOnEmptyBlob, true);
  }
Test range requests on a single chunk blob.
@param resolveRangeOnEmptyBlob the value of {@link GetBlobOptions#resolveRangeOnEmptyBlob()} to set.
ambry-router/src/test/java/com/github/ambry/router/GetBlobOperationTest.java