private void assertDataIdentity(ClusterMap clusterMap) throws IOException {
    if (!testEncryption) {
      ByteBuffer dest = ByteBuffer.allocate(totalSizeWritten);
      for (ByteBuf buf : compositeBuffers) {
        Assert.assertNotNull("All chunks should have come in", buf);
        for (ByteBuffer buffer : buf.nioBuffers()) {
          dest.put(buffer);
        }
      }
      Assert.assertTrue("Filled chunk contents must exactly match the input buffer ",
          Arrays.equals(putContent, dest.array()));
    } else {
      byte[] content = new byte[blobSize];
      AtomicInteger offset = new AtomicInteger(0);
      for (int i = 0; i < numChunks; i++) {
        DecryptJob decryptJob =
            new DecryptJob(compositeBlobIds[i], compositeEncryptionKeys[i], compositeBuffers[i], null, cryptoService,
                kms, null, new CryptoJobMetricsTracker(routerMetrics.decryptJobMetrics), (result, exception) -> {
              Assert.assertNull("Exception shouldn't have been thrown", exception);
              ByteBuf decryptedBlobContent = result.getDecryptedBlobContent();
              int chunkSize = decryptedBlobContent.readableBytes();
              decryptedBlobContent.readBytes(content, offset.get(), chunkSize);
              offset.addAndGet(chunkSize);
              decryptedBlobContent.release();
            });
        decryptJob.run();
      }
      Assert.assertTrue("Filled chunk contents must exactly match the input buffer ",
          Arrays.equals(putContent, content));
    }
  }
Ensure that the data filled in is exactly identical to the original content.
ambry-router/src/test/java/com/github/ambry/router/ChunkFillTest.java