@Test
  public void testRangeRequestStitchDifferentSizedBlobsSegments() throws Exception {
    if (metadataContentVersion > MessageFormatRecord.Metadata_Content_Version_V2) {
      router = getNonBlockingRouter();
      String blobId = createStitchBlob(LARGE_BLOB_SIZE);
      //Test grabbing every segment with various offset ranges
      for (int i = 0; i < NUM_STITCHED_CHUNKS; i++) {
        int chunkSize = (int) chunkInfos.get(i).getChunkSizeInBytes();
        // entire chunk, [0, chunkSize-1]
        this.options =
            new GetBlobOptionsBuilder().blobSegment(i).range(ByteRanges.fromOffsetRange(0, chunkSize - 1)).build();
        getBlobAndCompareContent(blobId, chunkSize);

        // overflow: [0, chunkSize]
        this.options =
            new GetBlobOptionsBuilder().blobSegment(i).range(ByteRanges.fromOffsetRange(0, chunkSize)).build();
        getBlobAndCompareContent(blobId, chunkSize);

        // more overflow: [0, chunkSize + 100]
        this.options =
            new GetBlobOptionsBuilder().blobSegment(i).range(ByteRanges.fromOffsetRange(0, chunkSize + 100)).build();
        getBlobAndCompareContent(blobId, chunkSize);

        // last N bytes: [chunkSize-1-N, chunkSize-1]
        this.options = new GetBlobOptionsBuilder().blobSegment(i).range(ByteRanges.fromLastNBytes(100)).build();
        getBlobAndCompareContent(blobId, chunkSize);

        // range: [chunkSize/2, chunkSize/2 + Random number]
        int end = new Random().nextInt(chunkSize / 2) + chunkSize / 2;
        this.options =
            new GetBlobOptionsBuilder().blobSegment(i).range(ByteRanges.fromOffsetRange(chunkSize / 2, end)).build();
        getBlobAndCompareContent(blobId, chunkSize);

        this.options = new GetBlobOptionsBuilder().blobSegment(i).range(ByteRanges.fromOffsetRange(0, 0)).build();
        getBlobAndCompareContent(blobId, chunkSize);
      }
      this.options = new GetBlobOptionsBuilder().operationType(GetBlobOptions.OperationType.BlobInfo).build();
      getBlobAndCompareContent(blobId, -1);
      router.close();
    } else {
      router = getNonBlockingRouter();
      router.close();
    }
  }
Tests the router range request interface on stitched blob segments.
@throws Exception
ambry-router/src/test/java/com/github/ambry/router/GetManagerTest.java