private StreamOffsetRangeSearchList sortAndMerge(List<StreamOffsetRange> streamOffsetRangeList) {
        if (streamOffsetRangeList.size() < 2) {
            return new StreamOffsetRangeSearchList(streamOffsetRangeList);
        }
        long streamId = streamOffsetRangeList.get(0).streamId();
        Collections.sort(streamOffsetRangeList);
        List<StreamOffsetRange> mergedList = new ArrayList<>();
        long start = -1L;
        long end = -1L;
        for (int i = 0; i < streamOffsetRangeList.size() - 1; i++) {
            StreamOffsetRange curr = streamOffsetRangeList.get(i);
            StreamOffsetRange next = streamOffsetRangeList.get(i + 1);
            if (start == -1) {
                start = curr.startOffset();
                end = curr.endOffset();
            }
            if (curr.endOffset() < next.startOffset()) {
                mergedList.add(new StreamOffsetRange(curr.streamId(), start, end));
                start = next.startOffset();
            }
            end = next.endOffset();
        }
        mergedList.add(new StreamOffsetRange(streamId, start, end));

        return new StreamOffsetRangeSearchList(mergedList);
    }
Split specified stream set object into stream objects.

@param objectMetadata     stream set object to split
@param cfs                List of CompletableFuture of StreamObject
@return true if split succeed, false otherwise
s3stream/src/main/java/com/automq/stream/s3/compact/CompactionManager.java