@Test
    void require_that_component_is_not_reused_when_class_is_changed() {
        assertThrows(IllegalStateException.class, () -> {
            ComponentGraph graph = buildGraphAndSetNoConfigs(SimpleComponent.class);
            SimpleComponent instance = getComponent(graph, SimpleComponent.class);

            ComponentGraph newGraph = buildGraphAndSetNoConfigs(SimpleComponent2.class);
            newGraph.reuseNodes(graph);
            SimpleComponent2 instance2 = getComponent(newGraph, SimpleComponent2.class);

            assertEquals(instance2.getId(), instance.getId());
            @SuppressWarnings("unused")
            SimpleComponent throwsException = getComponent(newGraph, SimpleComponent.class);
        });
    }
@author gjoranv
@author Tony Vaagenes
@author ollivir
container-core/src/test/java/com/yahoo/container/di/componentgraph/core/ReuseComponentsTest.java