WorkbenchMenuStandardNavBarView extends WorkbenchMenuNavBarView { @Override protected void selectElement(final ComplexPanel item) { iterateWidgets(navbarNav); if (item == null) { return; } item.addStyleName(Styles.ACTIVE); if (item.getParent() != null && item.getParent().getParent() instanceof ListDropDown) { item.getParent().getParent().addStyleName(Styles.ACTIVE); } }  @Override void addMenuItem(final String id,
                            final String label,
                            final String parentId,
                            final Command command,
                            final MenuPosition position); @Override void addCustomMenuItem(final Widget menu,
                                  final MenuPosition position); @Override void addGroupMenuItem(final String id,
                                 final String label,
                                 final MenuPosition position); @Override void addContextMenuItem(
            final String menuItemId,
            final String id,
            final String label,
            final String parentId,
            final Command command,
            final MenuPosition position); @Override void addContextGroupMenuItem(final String menuItemId,
                                        final String id,
                                        final String label,
                                        final MenuPosition position); @Override void clearContextMenu(); @Override void selectMenuItem(final String id);  }
@Test public void testSelectElement() { final ListDropDown parent1 = mock(ListDropDown.class); final Widget parent2 = mock(Widget.class); final ComplexPanel panel = mock(ComplexPanel.class); when(navbarNav.iterator()).thenReturn(Collections.<Widget>emptyList().iterator()); when(panel.getParent()).thenReturn(parent2); when(parent2.getParent()).thenReturn(parent1); workbenchMenuStandardNavBarView.selectElement(panel); verify(panel).addStyleName(Styles.ACTIVE); verify(parent1).addStyleName(Styles.ACTIVE); }