code: synchronized void removeSegment(JournalSegment segment) {
      segments.remove(segment.index());
      segment.close();
      segment.delete();
      resetCurrentSegment();
    }
docs: Removes a segment.
  
  @param segment The segment to remove.