private long addCuratedUndeleteToLogSegment() throws StoreException {
    // Make sure we have these records
    // 1. P, D -> U
    // 2. P, T, D -> U
    // 3. P, D, U, D -> U
    // 4. P, D, U, T, D -> U

    int puts = 0, ttls = 0, deletes = 0, undeletes = 0;
    List<MockId> ids = put(4, CuratedLogIndexState.PUT_RECORD_SIZE, Utils.Infinite_Time);
    puts += 4;
    for (MockId id : ids) {
      idsByLogSegment.get(2).add(id);
    }
    MockId pd = ids.get(0);
    MockId ptd = ids.get(1);
    MockId pdud = ids.get(2);
    MockId pdutd = ids.get(3);

    // finish P, D
    delete(pd);
    deletes++;
    // finish P, T, D
    updateTtl(ptd);
    ttls++;
    delete(ptd);
    deletes++;
    // finish P, D, U, D
    delete(pdud);
    deletes++;
    undelete(pdud);
    undeletes++;
    delete(pdud);
    deletes++;
    // finish P, D, U, T, D
    delete(pdutd);
    deletes++;
    undelete(pdutd);
    undeletes++;
    updateTtl(pdutd);
    ttls++;
    delete(pdutd);
    deletes++;

    // add undelete to all of them
    for (MockId id : ids) {
      undelete(id);
    }
    undeletes += 4;
    return puts * PUT_RECORD_SIZE + ttls * TTL_UPDATE_RECORD_SIZE + deletes * DELETE_RECORD_SIZE
        + undeletes * UNDELETE_RECORD_SIZE;
  }
Add several undeleted blobs to cover some possible undeleted scenarios.
@throws StoreException
ambry-store/src/test/java/com/github/ambry/store/BlobStoreTest.java