private void checkRecoveryInfoEquivalence(MessageInfo info) {
    PersistentIndex.IndexEntryType toSearchFor = PersistentIndex.IndexEntryType.PUT;
    if (info.isDeleted()) {
      toSearchFor = PersistentIndex.IndexEntryType.DELETE;
    } else if (info.isUndeleted()) {
      toSearchFor = PersistentIndex.IndexEntryType.UNDELETE;
    } else if (info.isTtlUpdated()) {
      toSearchFor = PersistentIndex.IndexEntryType.TTL_UPDATE;
    }
    IndexValue value;
    try {
      value = state.index.findKey(info.getStoreKey(), null, EnumSet.of(toSearchFor));
    } catch (StoreException e) {
      throw new IllegalStateException(e);
    }
    assertEquals("Inconsistent size", info.getSize(), value.getSize());
    assertEquals("Inconsistent delete state ", info.isDeleted(), value.isDelete());
    // if the info says ttl update is true, then the value must reflect that. vice versa need not be true because put
    // infos won't have it set but the value returned from the index will if a ttl update was applied later. Same
    // applies if the info is for a delete record in which case it won't have the ttl update set to true because it is
    // not known at the time of the info generation from the log that the id was previously updated
    if (info.isTtlUpdated()) {
      assertTrue("Inconsistent ttl update state ", value.isTtlUpdate());
      assertEquals("Inconsistent expiresAtMs", info.getExpirationTimeInMs(), value.getExpiresAtMs());
    }
    assertEquals("Incorrect accountId", info.getAccountId(), value.getAccountId());
    assertEquals("Incorrect containerId", info.getContainerId(), value.getContainerId());
    assertEquals("Incorrect operationTimeMs", Utils.getTimeInMsToTheNearestSec(info.getOperationTimeMs()),
        value.getOperationTimeInMs());
    assertEquals("Inconsistent lifeVersion for info " + info, info.getLifeVersion(), value.getLifeVersion());
    assertEquals(info.isUndeleted(), value.isUndelete());
    assertEquals(info.isDeleted(), value.isDelete());
  }
Checks that the details in {@code info} are equivalent to the value returned from the index.
@param info the {@link MessageInfo} to check.
ambry-store/src/test/java/com/github/ambry/store/IndexTest.java