@Test
    void bundle_from_previous_generation_is_uninstalled_when_not_used_in_the_new_generation() {
        ComponentEntry component1 = new ComponentEntry("component1", SimpleComponent.class);
        ComponentEntry component2 = new ComponentEntry("component2", SimpleComponent.class);

        writeBootstrapConfigsWithBundles(List.of("bundle-1"), List.of(component1));
        Container container = newContainer(dirConfigSource);
        ComponentGraph graph = getNewComponentGraph(container);

        // bundle-1 is installed
        assertEquals(1, osgi.getBundles().length);
        assertEquals("bundle-1", osgi.getBundles()[0].getSymbolicName());

        writeBootstrapConfigsWithBundles(List.of("bundle-2"), List.of(component2));
        container.reloadConfig(2);
        ComponentGraph newGraph = getNewComponentGraph(container, graph);

        // bundle-2 is installed, bundle-1 has been uninstalled
        assertEquals(1, osgi.getBundles().length);
        assertEquals("bundle-2", osgi.getBundles()[0].getSymbolicName());

        container.shutdownConfigRetriever();
        container.shutdown(newGraph);
    }
@author Tony Vaagenes
@author gjoranv
@author ollivir
container-core/src/test/java/com/yahoo/container/di/ContainerTest.java