private static Long getLatestSessionId(Curator curator, Path appsPath) {
        if (!applicationExists(curator, appsPath)) return null;
        Long newestGeneration = null;
        try {
            if (!getDeployedApplicationGenerations(curator, appsPath).isEmpty()) {
                newestGeneration = Collections.max(getDeployedApplicationGenerations(curator, appsPath));
            }
        } catch (Exception e) {
            log.log(Level.WARNING, "Could not get newest application generation from Zookeeper");
        }
        return newestGeneration;
    }
Returns the application generation for the most recently deployed application from ZK,
or null if no application has been deployed yet

@return generation of the latest deployed application
configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/InitializedCounter.java