code: private void compactGroup(List<Segment> segments, List<OffsetPredicate> predicates, Segment compactSegment) {
      // Iterate through all segments being compacted and write entries to a single compact segment.
      for (int i = 0; i < segments.size(); i++) {
        compactSegment(segments.get(i), predicates.get(i), compactSegment);
      }
    }
docs: Compacts segments in a group sequentially.
  
  @param segments The segments to compact.
  @param compactSegment The compact segment.