private boolean shouldSkipCreatingMajorVersionOnError(List<Integer> majorVersions, Integer majorVersion, Version wantedVersion,
                                                          AllocatedHostsFromAllModels allHosts) {
        if (majorVersion.equals(wantedVersion.getMajor())) return false;        // Ensure we are valid for our targeted major.
        if (allHosts.toAllocatedHosts().getHosts().stream()
                    .flatMap(host -> host.version().stream())
                    .map(Version::getMajor)
                    .anyMatch(majorVersion::equals)) return false;              // Ensure we are valid for our currently deployed major.
        if (majorVersion.equals(Collections.min(majorVersions))) return false;  // Probably won't happen if the other two are both false ... ?
        // Note: This needs to be bumped when we no longer want to support successfully deploying
        // applications that are not working on version 8, but are working on a lower major version (unless
        // apps have explicitly defined major version to deploy to in application package)
        return majorVersion >= 8;
    }
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