private static List<Integer> majorVersionsNewestFirst(Set<Version> versions) {
        return versions.stream()
                       .map(Version::getMajor)
                       .distinct()
                       .sorted(Comparator.reverseOrder())
                       .toList();
    }
Builds all applicable model versions

@param allocatedHosts the newest version (major and minor) (which is loaded first) decides the allocated hosts
                      and assigns to this SettableOptional such that it can be used after this method returns
configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ModelsBuilder.java