### Question:
DefaultWorkbenchFeaturesMenusHelper { public void addRolesMenuItems() { for (Menus roleMenus : getRoles()) { userMenu.addMenus(roleMenus); } } DefaultWorkbenchFeaturesMenusHelper(); @Inject  DefaultWorkbenchFeaturesMenusHelper(SyncBeanManager iocManager,
                                               ActivityManager activityManager,
                                               PerspectiveManager perspectiveManager,
                                               Caller<AuthenticationService> authService,
                                               User identity,
                                               UserMenu userMenu,
                                               UtilityMenuBar utilityMenuBar,
                                               WorkbenchMegaMenuPresenter menuBar,
                                               AboutCommand aboutCommand,
                                               AuthorizationManager authorizationManager,
                                               SessionInfo sessionInfo,
                                               PlaceManager placeManager); List<? extends MenuItem> getHomeViews(); List<MenuItem> getAuthoringViews(); List<? extends MenuItem> getProcessManagementViews(); List<? extends MenuItem> getExtensionsViews(); void addRolesMenuItems(); void addGroupsMenuItems(); void addWorkbenchViewModeSwitcherMenuItem(); void addWorkbenchConfigurationMenuItem(); void addUtilitiesMenuItems(); void addUserMenuItems(); String getDefaultPerspectiveIdentifier(); List<PerspectiveActivity> getPerspectiveActivities(); List<MenuItem> getPerspectivesMenuItems(); List<Menus> getRoles(); List<Menus> getGroups(); TopLevelMenusBuilder<MenuBuilder> buildMenusFromNavTree(NavTree navTree); List<MenuItem> buildMenuItemsFromNavGroup(NavGroup navGroup); PlaceRequest resolvePlaceRequest(String perspectiveId); static native void redirect(String url);  }### Answer:
@Test public void addRolesMenuItemsTest() { menusHelper.addRolesMenuItems(); ArgumentCaptor<Menus> menusCaptor = ArgumentCaptor.forClass(Menus.class); verify(userMenu, times(3)).addMenus(menusCaptor.capture()); List<Menus> menusList = menusCaptor.getAllValues(); assertEquals(3, menusList.size()); assertEquals(1, menusList.get(0).getItems().size()); assertEquals(1, menusList.get(1).getItems().size()); assertEquals(1, menusList.get(2).getItems().size()); checkIfMenuContainsRole(menusList, menusHelper.constants.LogOut()); checkIfMenuContainsRole(menusList, "Role: role1"); checkIfMenuContainsRole(menusList, "Role: role2"); }