private Set<MockId> getCurrentBlobIdsFromWholeIndex(PersistentIndex index, Set<MockId> removableDeletes,
      boolean checkRemovableDeletes) {
    Set<MockId> seenPuts = new HashSet<>();
    Set<MockId> allBlobIds = new HashSet<>();
    for (IndexSegment indexSegment : index.getIndexSegments().values()) {
      Iterator<IndexEntry> iterator = indexSegment.iterator();
      while (iterator.hasNext()) {
        IndexEntry indexEntry = iterator.next();
        MockId key = (MockId) indexEntry.getKey();
        IndexValue indexValue = indexEntry.getValue();
        allBlobIds.add(key);
        if (indexValue.isDelete()) {
          if (!seenPuts.contains(key)) {
            // Here we don't check delete version based on the assumption that the solitary delete (no PUT associated)
            // should be final delete. Deletes with lower version (if any) should have been compacted already.
            if (removableDeletes != null && checkRemovableDeletes && indexValue.getExpiresAtMs() != Utils.Infinite_Time
                && indexValue.getExpiresAtMs() < state.time.milliseconds()) {
              removableDeletes.add(key);
            }
          }
        } else if (indexValue.isPut()) {
          seenPuts.add(key);
        }
      }
    }
    return allBlobIds;
  }
Find the current blob ids (no matter what status it is) from given {@link PersistentIndex}.
@param index the {@link PersistentIndex} to search from.
@param removableDeletes a removable deletes set to populate (the delete tombstones will be added to it).
@param checkRemovableDeletes whether to check removable deletes. If {@code true}, the removableDeletes set should
                             be populated.
@return a set of current blob ids in given {@link PersistentIndex}
ambry-store/src/test/java/com/github/ambry/store/BlobStoreCompactorTest.java