### Question:
ComponentRuntime extends AbstractComponentContainer { @Override @SuppressWarnings("unchecked") public <T> Provider<T> getProvider(Class<T> anInterface) { Preconditions.checkNotNull(anInterface, "Null interface requested."); return (Provider<T>) lazyInstanceMap.get(anInterface); } ComponentRuntime(
      Executor defaultEventExecutor,
      Iterable<ComponentRegistrar> registrars,
      Component<?>... additionalComponents); @Override @SuppressWarnings("unchecked") Provider<T> getProvider(Class<T> anInterface); @Override @SuppressWarnings("unchecked") Provider<Set<T>> setOfProvider(Class<T> anInterface); void initializeEagerComponents(boolean isDefaultApp); @VisibleForTesting @RestrictTo(Scope.TESTS) void initializeAllComponentsForTests();  }### Answer:
@Test public void container_withCyclicProviderDependency_shouldProperlyInitialize() { ComponentRuntime runtime = new ComponentRuntime( EXECUTOR, Collections.emptyList(), Component.builder(CyclicOne.class) .add(Dependency.required(CyclicTwo.class)) .factory(container -> new CyclicOne(container.get(CyclicTwo.class))) .build(), Component.builder(CyclicTwo.class) .add(Dependency.requiredProvider(CyclicOne.class)) .factory(container -> new CyclicTwo(container.getProvider(CyclicOne.class))) .build()); CyclicOne one = runtime.get(CyclicOne.class); assertThat(one.cyclicTwo).isNotNull(); Provider<CyclicOne> oneProvider = one.cyclicTwo.cyclicOne; assertThat(oneProvider).isNotNull(); assertThat(oneProvider.get()).isSameInstanceAs(one); }
@Test public void container_shouldExposeAllProvidedInterfacesOfAComponent() { ComponentRuntime runtime = new ComponentRuntime( EXECUTOR, Collections.emptyList(), Component.builder(Child.class, Parent.class).factory(c -> new Child()).build()); Provider<Child> child = runtime.getProvider(Child.class); assertThat(child).isNotNull(); Provider<Parent> parent = runtime.getProvider(Parent.class); assertThat(parent).isNotNull(); assertThat(child).isSameInstanceAs(parent); assertThat(child.get()).isSameInstanceAs(parent.get()); }