protected int assertMissingKeysAndFixMissingStoreKeys(int expectedIndex, int expectedIndexInc,
      int expectedMissingKeysSum, ReplicaThread replicaThread,
      Map<DataNodeId, List<RemoteReplicaInfo>> replicasToReplicate) throws Exception {
    expectedIndex += expectedIndexInc;
    replicaThread.replicate();
    for (DataNodeId dataNodeId : replicasToReplicate.keySet()) {
      List<ReplicaThread.ExchangeMetadataResponse> response =
          replicaThread.getExchangeMetadataResponsesInEachCycle().get(dataNodeId);
      assertEquals("Response should contain a response for each replica", replicasToReplicate.get(dataNodeId).size(),
          response.size());
      for (int i = 0; i < response.size(); i++) {
        assertEquals(expectedMissingKeysSum, response.get(i).missingStoreMessages.size());
        assertEquals(expectedIndex, ((MockFindToken) response.get(i).remoteToken).getIndex());
        assertEquals("Token should have been set correctly", response.get(i).remoteToken,
            replicasToReplicate.get(dataNodeId).get(i).getToken());
      }
    }
    return expectedIndex;
  }
Asserts the number of missing keys between the local and remote replicas and fixes the keys
@param expectedIndex initial expected index
@param expectedIndexInc increment level for the expected index (how much the findToken index is expected to increment)
@param expectedMissingKeysSum the number of missing keys expected
@param replicaThread replicaThread that will be performing replication
@param replicasToReplicate list of replicas to replicate between
@return expectedIndex + expectedIndexInc
@throws Exception
ambry-replication/src/test/java/com/github/ambry/replication/ReplicationTestHelper.java