private void 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

    List<IndexEntry> entries = addPutEntries(4, CuratedLogIndexState.DELETE_RECORD_SIZE, Infinite_Time);
    IndexEntry pd = entries.get(0);
    IndexEntry ptd = entries.get(1);
    IndexEntry pdud = entries.get(2);
    IndexEntry pdutd = entries.get(3);

    MockId id = null;
    // finish P, D
    id = (MockId) pd.getKey();
    addDeleteEntry(id);
    // finish P, T, D
    id = (MockId) ptd.getKey();
    makePermanent(id, false);
    addDeleteEntry(id);
    // finish P, D, U, D
    id = (MockId) pdud.getKey();
    addDeleteEntry(id);
    addUndeleteEntry(id);
    addDeleteEntry(id);
    // finish P, D, U, T, D
    id = (MockId) pdutd.getKey();
    addDeleteEntry(id);
    addUndeleteEntry(id);
    makePermanent(id, false);
    addDeleteEntry(id);

    // add undelete to all of them
    for (IndexEntry ent : entries) {
      addUndeleteEntry((MockId) ent.getKey());
    }

    // Add records from replication, make sure we have these records
    // 1. P0 -> U3
    // 2. P0, T0 -> U3
    // 3. P0, U1 -> U3
    entries = addPutEntries(3, CuratedLogIndexState.DELETE_RECORD_SIZE, Infinite_Time);
    IndexEntry ptu = entries.get(1);
    IndexEntry puu = entries.get(2);

    // finish P, T
    id = (MockId) ptu.getKey();
    makePermanent(id, false);

    // finish P, U
    id = (MockId) puu.getKey();
    addUndeleteEntry(id, (short) 1);

    // add undelete to all of them
    for (IndexEntry ent : entries) {
      addUndeleteEntry((MockId) ent.getKey(), (short) 3);
    }
  }
Add several undeleted blobs to cover some possible undeleted scenarios.
@throws StoreException
ambry-store/src/test/java/com/github/ambry/store/CuratedLogIndexState.java