WorkbenchMenuCompactNavBarView extends WorkbenchMenuNavBarView { @Override protected void selectElement(final ComplexPanel item) { for (Widget widget : dropDownMenu) { widget.removeStyleName(Styles.ACTIVE); } if (item != null) { item.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); @Override void clear();  }
@Test public void testSelectElement() { final ComplexPanel panel = mock(ComplexPanel.class); final ComplexPanel panelActive = mock(ComplexPanel.class); when(dropDownMenu.iterator()).thenReturn(Collections.<Widget>singletonList(panel).iterator()); workbenchMenuCompactNavBarView.selectElement(panelActive); verify(panelActive).addStyleName(Styles.ACTIVE); verify(panel).removeStyleName(Styles.ACTIVE); }