public static int getTotalObjectStats(CompactedObjectBuilder o, Map<Long, Integer> objectStatsMap) {
        int totalCompactedObjects = 0;
        for (Long objectId : o.uniqueObjectIds()) {
            totalCompactedObjects += objectStatsMap.get(objectId);
        }
        return totalCompactedObjects;
    }
Group stream data blocks by certain conditions.

@param streamDataBlocks stream data blocks to be grouped
@param predicate        the predicate to check whether a stream data block should be grouped with the previous one
@return grouped stream data blocks
s3stream/src/main/java/com/automq/stream/s3/compact/utils/CompactionUtils.java