code: private void checkEntry(long index, Segment segment, Segment compactSegment) {
      try (Entry entry = segment.get(index)) {
        // If an entry was found, only remove the entry from the segment if it's not a tombstone that has been released.
        if (entry != null) {
          checkEntry(index, entry, segment, compactSegment);
        } else {
          compactSegment.skip(1);
        }
      }
    }
docs: Compacts the entry at the given index.
  
  @param index The index at which to compact the entry.
  @param segment The segment to compact.
  @param compactSegment The segment to which to write the compacted segment.