docs: public void compact(long index) {
      Map.Entry<Long, JournalSegment<E>> segmentEntry = segments.floorEntry(index);
      if (segmentEntry != null) {
        SortedMap<Long, JournalSegment<E>> compactSegments = segments.headMap(segmentEntry.getValue().index());
        if (!compactSegments.isEmpty()) {
          log.debug("{} - Compacting {} segment(s)", name, compactSegments.size());
          for (JournalSegment segment : compactSegments.values()) {
            log.trace("Deleting segment: {}", segment);
            segment.close();
            segment.delete();
          }
          compactSegments.clear();
          resetHead(segmentEntry.getValue().index());
        }
      }
    }