@Test
    void component_can_be_explicitly_injected_into_another_component() {
        Node injectedComponent = mockComponentNode(SimpleComponent.class);
        Node targetComponent = mockComponentNode(ComponentTakingComponent.class);
        targetComponent.inject(injectedComponent);

        Node destroyGlobalLookupComponent = mockComponentNode(SimpleComponent.class);

        ComponentGraph componentGraph = new ComponentGraph();
        componentGraph.add(injectedComponent);
        componentGraph.add(targetComponent);
        componentGraph.add(destroyGlobalLookupComponent);
        componentGraph.complete();

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