### Question:
ParentController extends ChildController { @Nullable @Override public ViewController findController(final String id) { ViewController fromSuper = super.findController(id); if (fromSuper != null) return fromSuper; for (ViewController child : getChildControllers()) { ViewController fromChild = child.findController(id); if (fromChild != null) return fromChild; } return null; } ParentController(Activity activity, ChildControllersRegistry childRegistry, String id, Presenter presenter, Options initialOptions); @Override void setWaitForRender(Bool waitForRender); @Override void setDefaultOptions(Options defaultOptions); @Override @CheckResult Options resolveCurrentOptions(); @Override @CheckResult Options resolveCurrentOptions(Options defaultOptions); @NonNull @Override T getView(); @NonNull abstract Collection<? extends ViewController> getChildControllers(); @Nullable @Override ViewController findController(final String id); @Override boolean containsComponent(Component component); @CallSuper void applyChildOptions(Options options, Component child); @CallSuper void mergeChildOptions(Options options, ViewController childController, Component child); @Override void destroy(); void setupTopTabsWithViewPager(ViewPager viewPager); void clearTopTabs(); @Override boolean isRendered(); void onChildDestroyed(Component child);  }### Answer:
@Test public void findControllerById_ChildById() { SimpleViewController child1 = new SimpleViewController(activity, childRegistry, "child1", new Options()); SimpleViewController child2 = new SimpleViewController(activity, childRegistry, "child2", new Options()); children.add(child1); children.add(child2); assertThat(uut.findController("uut")).isEqualTo(uut); assertThat(uut.findController("child1")).isEqualTo(child1); }
@Test public void findControllerById_Recursive() { StackController stackController = TestUtils.newStackController(activity).build(); stackController.ensureViewIsCreated(); SimpleViewController child1 = new SimpleViewController(activity, childRegistry, "child1", new Options()); SimpleViewController child2 = new SimpleViewController(activity, childRegistry, "child2", new Options()); stackController.push(child1, new CommandListenerAdapter()); stackController.push(child2, new CommandListenerAdapter()); children.add(stackController); assertThat(uut.findController("child2")).isEqualTo(child2); }