@SuppressWarnings("deprecation")
    @Test
    void require_that_component_is_not_reused_when_config_is_changed() {
        Class<ComponentTakingConfig> componentClass = ComponentTakingConfig.class;

        ComponentGraph graph = buildGraph(componentClass);
        graph.setAvailableConfigs(Map.of(new ConfigKey<>(TestConfig.class, "component"),
                ConfigGetter.getConfig(TestConfig.class, "raw: stringVal \"oldConfig\"")));
        ComponentTakingConfig instance = getComponent(graph, componentClass);

        ComponentGraph newGraph = buildGraph(componentClass);
        newGraph.setAvailableConfigs(Map.of(new ConfigKey<>(TestConfig.class, "component"),
                ConfigGetter.getConfig(TestConfig.class, "raw: stringVal \"newConfig\"")));
        newGraph.reuseNodes(graph);
        ComponentTakingConfig instance2 = getComponent(newGraph, componentClass);

        assertNotSame(instance2, instance);
    }
@author gjoranv
@author Tony Vaagenes
@author ollivir
container-core/src/test/java/com/yahoo/container/di/componentgraph/core/ReuseComponentsTest.java