protected void ensureStitchInAllServers(String blobId, MockServerLayout serverLayout, List<ChunkInfo> chunksToStitch,
      int singleBlobSize) throws IOException {
    TreeMap<Integer, Pair<StoreKey, Long>> indexToChunkIdsAndChunkSizes = new TreeMap<>();
    int i = 0;
    for (ChunkInfo chunkInfo : chunksToStitch) {
      indexToChunkIdsAndChunkSizes.put(i,
          new Pair<>(new BlobId(chunkInfo.getBlobId(), mockClusterMap), chunkInfo.getChunkSizeInBytes()));
      i++;
    }
    ByteBuffer serializedContent;
    int totalSize = singleBlobSize * chunksToStitch.size();
    if (routerConfig.routerMetadataContentVersion == MessageFormatRecord.Metadata_Content_Version_V2) {
      serializedContent = MetadataContentSerDe.serializeMetadataContentV2(singleBlobSize, totalSize,
          indexToChunkIdsAndChunkSizes.values().stream().map(Pair::getFirst).collect(Collectors.toList()));
    } else {
      List<Pair<StoreKey, Long>> orderedChunkIdList = new ArrayList<>(indexToChunkIdsAndChunkSizes.values());
      serializedContent = MetadataContentSerDe.serializeMetadataContentV3(totalSize, orderedChunkIdList);
    }
    BlobId id = new BlobId(blobId, mockClusterMap);
    for (MockServer server : serverLayout.getMockServers()) {
      if (!server.getBlobs().containsKey(blobId)) {
        PutRequest putRequest =
            new PutRequest(NonBlockingRouter.correlationIdGenerator.incrementAndGet(), routerConfig.routerHostname, id,
                putBlobProperties, ByteBuffer.wrap(putUserMetadata), Unpooled.wrappedBuffer(serializedContent),
                serializedContent.remaining(), BlobType.MetadataBlob, null);
        server.send(putRequest).release();
        putRequest.release();
      }
    }
  }
Ensure that Stitch requests for given blob id reaches to all the mock servees in the {@link MockServerLayout}.
@param blobId The blob id of which stitch request will be created.
@param serverLayout The mock server layout.
@param chunksToStitch The list of {@link ChunkInfo} to stitch.
@param singleBlobSize The size of each chunk
@throws IOException
ambry-router/src/test/java/com/github/ambry/router/NonBlockingRouterTestBase.java