private Map<FileReference, Bundle> removeObsoleteReferences(List<FileReference> newReferences) {
        Map<FileReference, Bundle> obsoleteReferences = new LinkedHashMap<>(activeBundles);
        newReferences.forEach(obsoleteReferences::remove);

        obsoleteReferences.forEach(activeBundles::remove);
        return obsoleteReferences;
    }
Calculates the set of bundles that are not needed by the new application generation and
removes them from the map of active bundles.

Returns the map of bundles that are not needed by the new application generation.
container-core/src/main/java/com/yahoo/container/core/config/ApplicationBundleLoader.java