@Test
    void explicitly_injected_component_can_also_be_injected_implicitly() {
        Node injected = mockComponentNode(SimpleComponent.class);
        Node target = mockComponentNode(ComponentTakingComponent.class);
        target.inject(injected);
        Node implicit = mockComponentNode(ComponentTakingComponent.class);

        ComponentGraph componentGraph = new ComponentGraph();
        componentGraph.add(injected);
        componentGraph.add(target);
        componentGraph.add(implicit);
        componentGraph.complete();

        injected.constructInstance();
        target.constructInstance();
        implicit.constructInstance();

        var targetInstance = (ComponentTakingComponent)target.constructedInstance().get();
        var implicitInstance = (ComponentTakingComponent)implicit.constructedInstance().get();
        assertSame(targetInstance.injectedComponent, implicitInstance.injectedComponent);
    }
@author gjoranv
@author Tony Vaagenes
@author ollivir
container-core/src/test/java/com/yahoo/container/di/componentgraph/core/ComponentGraphTest.java