private Optional<Application> resolveForVersion(Version vespaVersion, Instant now) {
        Application application = applications.get(vespaVersion);
        if (application != null)
            return Optional.of(application);

        // Does the latest version specify that we can use it regardless?
        Application latest = applications.get(latestVersion);
        if (latest.getModel().allowModelVersionMismatch(now))
            return Optional.of(latest);

        return Optional.empty();
    }
Returns an application for the specified version, or the latest if not specified, or if the given version is not
available and the latest is a permissible substitution.

@throws VersionDoesNotExistException if the specified version is not available and the latest version is not
                                     a permissible substitution
configserver/src/main/java/com/yahoo/vespa/config/server/application/ApplicationVersions.java