public static BootstrapMetadata fromRecords(List<ApiMessageAndVersion> records, String source) {
        MetadataVersion metadataVersion = null;
        for (ApiMessageAndVersion record : records) {
            Optional<MetadataVersion> version = recordToMetadataVersion(record.message());
            if (version.isPresent()) {
                metadataVersion = version.get();
            }
        }
        if (metadataVersion == null) {
            throw new RuntimeException("No FeatureLevelRecord for " + MetadataVersion.FEATURE_NAME +
                    " was found in the bootstrap metadata from " + source);
        }
        return new BootstrapMetadata(records, metadataVersion, source);
    }
The bootstrap metadata. On startup, if the metadata log is empty, we will populate the log with
these records. Alternately, if log is not empty, but the metadata version is not set, we will
use the version specified here.
metadata/src/main/java/org/apache/kafka/metadata/bootstrap/BootstrapMetadata.java