public static long sizeInBytes(Collection<LogSegment> segments) {
        return segments.stream().mapToLong(LogSegment::size).sum();
    }
Calculate a log's size (in bytes) from the provided log segments.

@param segments The log segments to calculate the size of
@return Sum of the log segments' sizes (in bytes)
storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegments.java