public Optional<Map.Entry<Long, LogSegment>> firstEntry() {
        return Optional.ofNullable(segments.firstEntry());
    }
Return the entry associated with the smallest offset, if it exists.

This method is thread-safe.
storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegments.java