public LogSegment add(LogSegment segment) {
        return this.segments.put(segment.baseOffset(), segment);
    }
Add the given segment, or replace an existing entry.

This method is thread-safe.

@param segment the segment to add
storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegments.java