private static FinalizedFeatureKeyCollection createFinalizedFeatureKeys(
        Map<String, Short> finalizedFeatures) {
        FinalizedFeatureKeyCollection converted = new FinalizedFeatureKeyCollection();
        for (Map.Entry<String, Short> feature : finalizedFeatures.entrySet()) {
            final FinalizedFeatureKey key = new FinalizedFeatureKey();
            final short versionLevel = feature.getValue();
            if (versionLevel != 0) {
                key.setName(feature.getKey());
                key.setMinVersionLevel(versionLevel);
                key.setMaxVersionLevel(versionLevel);
                converted.add(key);
            }
        }

        return converted;
    }
Find the common range of supported API versions between the locally
known range and that of another set.

@param listenerType the listener type which constrains the set of exposed APIs
@param minRecordVersion min inter broker magic
@param activeControllerApiVersions controller ApiVersions
@param enableUnstableLastVersion whether unstable versions should be advertised or not
@param clientTelemetryEnabled whether client telemetry is enabled or not
@return commonly agreed ApiVersion collection
clients/src/main/java/org/apache/kafka/common/requests/ApiVersionsResponse.java