private Pair<Integer, Pair<Executor, Executor>> buildGraphWithChildInjector(Supplier<Executor> executorProvider) {
        Injector childInjector = Guice.createInjector(new AbstractModule() {
            @Override
            public void configure() {
                bind(Executor.class).toProvider(executorProvider::get);
            }
        });

        ComponentGraph componentGraph = new ComponentGraph();

        Key<ComponentTakingExecutor> keyA = Key.get(ComponentTakingExecutor.class, Names.named("A"));
        Key<ComponentTakingExecutor> keyB = Key.get(ComponentTakingExecutor.class, Names.named("B"));

        componentGraph.add(mockComponentNode(keyA));
        componentGraph.add(mockComponentNode(keyB));

        componentGraph.complete(childInjector);

        return new Pair<>(componentGraph.size(),
                new Pair<>(componentGraph.getInstance(keyA).executor, componentGraph.getInstance(keyB).executor));
    }
@author gjoranv
@author Tony Vaagenes
@author ollivir
container-core/src/test/java/com/yahoo/container/di/componentgraph/core/ComponentGraphTest.java