GridSubMenu extends SubMenuBase<GridContextMenu<T>, GridMenuItem<T>, GridSubMenu<T>> implements HasGridMenuItems<T> { @Override public GridMenuItem<T> addItem(String text, ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener) { GridMenuItem<T> menuItem = addItem(text); if (clickListener != null) { menuItem.addMenuItemClickListener(clickListener); } return menuItem; } GridSubMenu(GridMenuItem<T> parentMenuItem,
            SerializableRunnable contentReset); @Override GridMenuItem<T> addItem(String text,
            ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener); @Override GridMenuItem<T> addItem(Component component,
            ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener);  }
@Test public void addTextItem_delegateToMenuManager() { TestContextMenu menu = new TestContextMenu(); menu.addItem("foo", null); Mockito.verify(menuManager).addItem("foo"); }
@Test public void addComponentItem_delegateToMenuManager() { TestContextMenu menu = new TestContextMenu(); Component component = Mockito.mock(Component.class); menu.addItem(component, null); Mockito.verify(menuManager).addItem(component); }