protected void checkBlobMessagesAreEqualInLocalAndRemoteHosts(MockHost localHost, MockHost remoteHost,
      Map<PartitionId, List<StoreKey>> idsToBeIgnoredByPartition,
      Map<PartitionId, List<StoreKey>> idsToBeTtlUpdatedByPartition) {

    for (Map.Entry<PartitionId, List<MessageInfo>> remoteInfoEntry : remoteHost.infosByPartition.entrySet()) {
      List<MessageInfo> remoteInfos = remoteInfoEntry.getValue();
      List<MessageInfo> localInfos = localHost.infosByPartition.get(remoteInfoEntry.getKey());
      int remoteIndex = 0;

      Set<StoreKey> seen = new HashSet<>();
      for (MessageInfo remoteInfo : remoteInfos) {
        StoreKey id = remoteInfo.getStoreKey();
        if (seen.add(id)) {
          MessageInfo localInfo = getMessageInfo(id, localInfos, false, false, false);
          if (localInfo == null) {
            assertTrue("Should be ignored", idsToBeIgnoredByPartition.get(remoteInfoEntry.getKey()).contains(id));
          } else {
            assertFalse("Should not be ignored",
                idsToBeIgnoredByPartition.get(remoteInfoEntry.getKey()) != null && idsToBeIgnoredByPartition.get(
                    remoteInfoEntry.getKey()).contains(id));
            MessageInfo mergedLocalInfo = getMergedMessageInfo(id, localInfos);
            MessageInfo mergedRemoteInfo = getMergedMessageInfo(id, remoteInfos);
            assertEquals(mergedLocalInfo.isDeleted(), mergedRemoteInfo.isDeleted());
            assertEquals(mergedLocalInfo.isTtlUpdated(), mergedRemoteInfo.isTtlUpdated());
            assertEquals(mergedLocalInfo.isTtlUpdated(),
                idsToBeTtlUpdatedByPartition.get(remoteInfoEntry.getKey()).contains(id));
            assertEquals(mergedLocalInfo.getLifeVersion(), mergedRemoteInfo.getLifeVersion());
            assertEquals(mergedLocalInfo.getAccountId(), mergedRemoteInfo.getAccountId());
            assertEquals(mergedLocalInfo.getContainerId(), mergedRemoteInfo.getContainerId());
            assertEquals("Key " + id, mergedLocalInfo.getExpirationTimeInMs(),
                mergedRemoteInfo.getExpirationTimeInMs());
            ByteBuffer putRecordBuffer = null;
            for (int i = 0; i < localInfos.size(); i++) {
              if (localInfo.equals(localInfos.get(i))) {
                putRecordBuffer = localHost.buffersByPartition.get(remoteInfoEntry.getKey()).get(i).duplicate();
                break;
              }
            }
            assertNotNull(putRecordBuffer);
            // Make sure the put buffer contains the same info as the message Info
            assertPutRecord(putRecordBuffer,
                remoteHost.buffersByPartition.get(remoteInfoEntry.getKey()).get(remoteIndex).duplicate(),
                mergedLocalInfo);
          }
        }
        remoteIndex++;
      }
    }
  }
Verifies that blob messages across all partitions at local and remote hosts are equal.
ambry-replication/src/test/java/com/github/ambry/replication/ReplicationTestHelper.java