@Test
    void all_created_components_are_returned_in_reverse_topological_order() {
        for (int i = 0; i < 10; i++) {
            Node innerComponent = mockComponentNode(SimpleComponent.class);
            Node middleComponent = mockComponentNode(ComponentTakingComponent.class);
            Node outerComponent = mockComponentNode(ComponentTakingComponentTakingComponent.class);

            ComponentGraph componentGraph = new ComponentGraph();
            componentGraph.add(innerComponent);
            componentGraph.add(middleComponent);
            componentGraph.add(outerComponent);
            componentGraph.complete();

            innerComponent.constructInstance();
            middleComponent.constructInstance();
            outerComponent.constructInstance();

            assertEquals(List.of(outerComponent.constructedInstance().get(), middleComponent.constructedInstance().get(), innerComponent.constructedInstance().get()),
                    componentGraph.allConstructedComponentsAndProviders());
        }
    }
@author gjoranv
@author Tony Vaagenes
@author ollivir
container-core/src/test/java/com/yahoo/container/di/componentgraph/core/ComponentGraphTest.java