@Test
    void provider_is_not_used_when_component_of_provided_class_exists() {
        ComponentGraph componentGraph = new ComponentGraph();

        componentGraph.add(mockComponentNode(SimpleComponent.class));
        componentGraph.add(mockComponentNode(SimpleComponentProviderThatThrows.class));
        componentGraph.add(mockComponentNode(ComponentTakingComponent.class));
        componentGraph.complete();

        SimpleComponent injectedComponent = componentGraph.getInstance(ComponentTakingComponent.class).injectedComponent;
        assertNotNull(injectedComponent);
    }
@author gjoranv
@author Tony Vaagenes
@author ollivir
container-core/src/test/java/com/yahoo/container/di/componentgraph/core/ComponentGraphTest.java