### Question:
ContextGrid extends BaseExpressionGrid<Context, ContextGridData, ContextUIModelMapper> implements HasRowDragRestrictions,
                                                                                                               HasListSelectorControl { @Override public void onItemSelected(final ListSelectorItem item) { final ListSelectorTextItem li = (ListSelectorTextItem) item; li.getCommand().execute(); } ContextGrid(final GridCellTuple parent,
                       final Optional<String> nodeUUID,
                       final HasExpression hasExpression,
                       final Optional<HasName> hasName,
                       final DMNGridPanel gridPanel,
                       final DMNGridLayer gridLayer,
                       final ContextGridData gridData,
                       final DefinitionUtils definitionUtils,
                       final SessionManager sessionManager,
                       final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                       final DefaultCanvasCommandFactory canvasCommandFactory,
                       final Event<ExpressionEditorChanged> editorSelectedEvent,
                       final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
                       final Event<DomainObjectSelectionEvent> domainObjectSelectionEvent,
                       final CellEditorControlsView.Presenter cellEditorControls,
                       final ListSelectorView.Presenter listSelector,
                       final TranslationService translationService,
                       final boolean isOnlyVisualChangeAllowed,
                       final int nesting,
                       final Supplier<ExpressionEditorDefinitions> expressionEditorDefinitionsSupplier,
                       final ValueAndDataTypePopoverView.Presenter headerEditor,
                       final ReadOnlyProvider readOnlyProvider); @Override ContextUIModelMapper makeUiModelMapper(); @Override void initialiseUiColumns(); @Override void initialiseUiRows(); @Override void initialiseUiCells(); @Override boolean isRowDragPermitted(final GridWidgetDnDHandlersState state); @Override @SuppressWarnings("unused") List<ListSelectorItem> getItems(final int uiRowIndex,
                                           final int uiColumnIndex); @Override void onItemSelected(final ListSelectorItem item); @Override void doAfterSelectionChange(final int uiRowIndex,
                                       final int uiColumnIndex); @Override void doAfterHeaderSelectionChange(final int uiHeaderRowIndex,
                                             final int uiHeaderColumnIndex);  }### Answer:
@Test public void testOnItemSelected() { setupGrid(0); final Command command = mock(Command.class); final HasListSelectorControl.ListSelectorTextItem listSelectorItem = mock(HasListSelectorControl.ListSelectorTextItem.class); when(listSelectorItem.getCommand()).thenReturn(command); grid.onItemSelected(listSelectorItem); verify(command).execute(); }