WorkbenchMenuCompactNavBarView extends WorkbenchMenuNavBarView { @Override public void addMenuItem(final String id, final String label, final String parentId, final Command command, final MenuPosition position) { final AnchorListItem menuItem = GWT.create(AnchorListItem.class); menuItem.setText(label); if (command != null) { menuItem.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { command.execute(); } }); } getMenuItemWidgetMap().put(id, menuItem); menuLabelMap.put(id, label); dropDownMenu.add(menuItem); }  @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 testAddMenuItem() { final String menuId = RandomStringUtils.random(10); final String menuParentId = null; final String label = RandomStringUtils.random(10); final MenuPosition position = MenuPosition.RIGHT; final Command command = mock(Command.class); workbenchMenuCompactNavBarView.addMenuItem(menuId, label, menuParentId, command, position); verify(dropDownMenu).add(anchorListItem); verify(anchorListItem).setText(label); assertEquals(anchorListItem, workbenchMenuCompactNavBarView.getMenuItemWidgetMap().get(menuId)); }