public FeatureVersion fromFeatureLevel(short level,
                                           boolean allowUnstableFeatureVersions) {
        return Arrays.stream(featureVersions).filter(featureVersion ->
            featureVersion.featureLevel() == level && (allowUnstableFeatureVersions || level <= latestProduction())).findFirst().orElseThrow(
                () -> new IllegalArgumentException("No feature:" + featureName() + " with feature level " + level));
    }
Creates a FeatureVersion from a level.

@param level                        the level of the feature
@param allowUnstableFeatureVersions whether unstable versions can be used
@return the FeatureVersionUtils.FeatureVersion for the feature the enum is based on.
@throws IllegalArgumentException    if the feature is not known.
server-common/src/main/java/org/apache/kafka/server/common/Features.java