WorkbenchMenuCompactNavBarView extends WorkbenchMenuNavBarView { @Override public void clearContextMenu() { super.clearContextMenu(); for (final ComplexPanel contextContainer : menuItemContextMenus.values()) { contextContainer.clear(); contextContainer.removeFromParent(); } menuItemContextMenus.clear(); }  @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 testClearContextMenu() { final String menuId = "menuId"; workbenchMenuCompactNavBarView.addContextMenuItem(menuId, "contextMenuItemId", "labelContextMenu", null, null, null); workbenchMenuCompactNavBarView.addContextGroupMenuItem(menuId, "contextGroupMenuId", "labelContextGroup", null); workbenchMenuCompactNavBarView.clearContextMenu(); assertTrue(workbenchMenuCompactNavBarView.getMenuItemContextMenus().isEmpty()); assertTrue(workbenchMenuCompactNavBarView.getMenuItemContextWidgetMap().isEmpty()); verify(anchorListItem, times(2)).clear(); verify(anchorListItem, times(2)).removeFromParent(); verify(listDropDown).clear(); verify(listDropDown).removeFromParent(); }