@Test
public void should_return_list_of_module_needed_by_widgets_in_tabscontainer_who_has_a_required_module() throws Exception {

    Component component1 = mockComponentFor(aWidget().modules("component1Module", "component1OtherModule"));
    Component component2 = mockComponentFor(aWidget().modules("component2Module", "component2OtherModule"));
    when(widgetRepository.get("pbTabsContainer")).thenReturn(aWidget().modules("tabContainerModule").build());
    when(widgetRepository.get("pbContainer")).thenReturn(aWidget().build());
    Set<String> modules = requiredModulesVisitor.visit(aTabsContainer().with(
            aTabContainer().with(aContainer().with(component1)),
            aTabContainer().with(aContainer().with(component2))).build());
    assertThat(modules).containsOnly("component1Module", "component1OtherModule", "component2Module", "component2OtherModule", "tabContainerModule");
}