private Set<Bundle> revertToPreviousGeneration() {
        log.info("Reverting to previous generation with bundles: " + obsoleteBundles);
        log.info("Bundles from latest generation will be removed: " + bundlesFromNewGeneration);
        activeBundles.putAll(obsoleteBundles);
        bundlesFromNewGeneration.forEach(activeBundles::remove);
        var ret = new LinkedHashSet<>(bundlesFromNewGeneration.values());

        // For correct operation of the CollisionHook (more specifically its FindHook implementation), the set of
        // allowed duplicates must reflect the next set of bundles to uninstall, which is now the bundles from the
        // failed generation.
        osgi.allowDuplicateBundles(ret);

        // Clear restore info in case this method is called multiple times, for some reason.
        bundlesFromNewGeneration = Map.of();
        obsoleteBundles = Map.of();

        readyForNewBundles = true;
        return ret;
    }
Restores state from the previous application generation and returns the set of bundles that
exclusively belongs to the latest (failed) application generation. Uninstalling must
be done by the Deconstructor as they may still be needed by components from the failed gen.
container-core/src/main/java/com/yahoo/container/core/config/ApplicationBundleLoader.java