public Application getForVersionOrLatest(Optional<Version> optionalVersion, Instant now) {
        Version version = optionalVersion.orElse(latestVersion);
        return resolveForVersion(version, now)
                 .orElseThrow(() -> new VersionDoesNotExistException(applicationId + " has no model for Vespa version " + version));
    }
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