code: private void compactSegment(Segment segment, OffsetPredicate predicate, Segment compactSegment) {
      for (long i = segment.firstIndex(); i <= segment.lastIndex(); i++) {
        checkEntry(i, segment, predicate, compactSegment);
      }
    }
docs: Compacts the given segment.
  
  @param segment The segment to compact.
  @param compactSegment The segment to which to write the compacted segment.