@Test
public void popToRoot() {

    StackController stack1 = newStack();
    StackController stack2 = newStack();
    BottomTabsController bottomTabsController = newTabs(Arrays.asList(stack1, stack2));
    uut.setRoot(bottomTabsController, new CommandListenerAdapter());
    stack1.push(child1, new CommandListenerAdapter());
    stack2.push(child2, new CommandListenerAdapter());
    stack2.push(child3, new CommandListenerAdapter());
    stack2.push(child4, new CommandListenerAdapter());
    stack2.push(child5, new CommandListenerAdapter() {
        @Override
        public void onSuccess(String childId) {
            uut.popToRoot(child3.getId(), Options.EMPTY, new CommandListenerAdapter());
            assertThat(stack2.getChildControllers()).containsOnly(child2);
        }
    });
}