@Test
public void mergeChildOptions_updatesParentControllerWithNewOptions() {

    StackController uut = new StackControllerBuilder(activity)
                    .setTopBarButtonCreator(new TopBarButtonCreatorMock())
                    .setTopBarBackgroundViewController(new TopBarBackgroundViewController(activity, new TopBarBackgroundViewCreatorMock()))
                    .setTopBarController(new TopBarController())
                    .setId("stack")
                    .setInitialOptions(new Options())
                    .setStackPresenter(new StackPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarButtonCreatorMock(), new ImageLoader(), new Options()))
                    .build();
    ParentController parentController = Mockito.mock(ParentController.class);
    uut.setParentController(parentController);
    uut.ensureViewIsCreated();
    Options optionsToMerge = new Options();
    optionsToMerge.topBar.testId = new Text("topBarID");
    optionsToMerge.bottomTabsOptions.testId = new Text("bottomTabsID");
    Component component = mock(Component.class);
    ViewController vc = mock(ViewController.class);
    uut.mergeChildOptions(optionsToMerge, vc, component);
    ArgumentCaptor<Options> captor = ArgumentCaptor.forClass(Options.class);
    verify(parentController, times(1)).mergeChildOptions(captor.capture(), eq(vc), eq(component));
    assertThat(captor.getValue().topBar.testId.hasValue()).isFalse();
    assertThat(captor.getValue().bottomTabsOptions.testId.get()).isEqualTo(optionsToMerge.bottomTabsOptions.testId.get());
}