private void ttlUpdateKeyAndVerify(StoreKey key, short expectedLifeVersion) throws StoreException {
    assertFalse("targetKey is already ttlUpdated", state.index.findKey(key).isTtlUpdate());
    short actualLifeVersion = state.index.findKey(key).getLifeVersion();
    assertEquals("Life version isn't " + expectedLifeVersion + " but " + actualLifeVersion, expectedLifeVersion,
        actualLifeVersion);
    state.appendToLog(TTL_UPDATE_RECORD_SIZE);
    FileSpan fileSpan = state.log.getFileSpanForMessage(state.index.getCurrentEndOffset(), TTL_UPDATE_RECORD_SIZE);
    state.index.markAsPermanent(key, fileSpan, System.currentTimeMillis());
    assertTrue("targetKey is not ttlUpdated", state.index.findKey(key).isTtlUpdate());
    actualLifeVersion = state.index.findKey(key).getLifeVersion();
    assertEquals("Life version isn't " + expectedLifeVersion + " but " + actualLifeVersion, expectedLifeVersion,
        actualLifeVersion);
  }
Tests and verifies a ttlUpdate with an expected life version
@param key the {@link StoreKey} to look up
@param expectedLifeVersion the expected lifeVersion
@throws StoreException
ambry-store/src/test/java/com/github/ambry/store/IndexTest.java