### Question:
DecisionTableGrid extends BaseExpressionGrid<DecisionTable, DecisionTableGridData, DecisionTableUIModelMapper> implements HasListSelectorControl,
                                                                                                                                       HasHitPolicyControl { void addInputClause(final int index) { getExpression().get().ifPresent(dtable -> { final InputClause clause = new InputClause(); final CommandResult<CanvasViolation> result = sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddInputClauseCommand(dtable, clause, model, () -> makeInputClauseColumn(index, clause), index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING), () -> resize(BaseExpressionGrid.RESIZE_EXISTING_MINIMUM))); if (!CommandUtils.isError(result)) { selectHeaderCell(0, index, false, false); CellContextUtilities.editSelectedCell(this); } }); } DecisionTableGrid(final GridCellTuple parent,
                             final Optional<String> nodeUUID,
                             final HasExpression hasExpression,
                             final Optional<HasName> hasName,
                             final DMNGridPanel gridPanel,
                             final DMNGridLayer gridLayer,
                             final DecisionTableGridData 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 HitPolicyPopoverView.Presenter hitPolicyEditor,
                             final ManagedInstance<ValueAndDataTypePopoverView.Presenter> headerEditors,
                             final ReadOnlyProvider readOnlyProvider); @Override DecisionTableUIModelMapper makeUiModelMapper(); @Override void initialiseUiColumns(); @Override void initialiseUiRows(); @Override void initialiseUiCells(); @Override @SuppressWarnings("unused") List<ListSelectorItem> getItems(final int uiRowIndex,
                                           final int uiColumnIndex); @Override void onItemSelected(final ListSelectorItem item); @Override HitPolicy getHitPolicy(); @Override BuiltinAggregator getBuiltinAggregator(); @Override void setHitPolicy(final HitPolicy hitPolicy,
                             final Command onSuccess); @Override void setBuiltinAggregator(final BuiltinAggregator aggregator); @Override void doAfterSelectionChange(final int uiRowIndex,
                                       final int uiColumnIndex); @Override void doAfterHeaderSelectionChange(final int uiHeaderRowIndex,
                                             final int uiHeaderColumnIndex);  }### Answer:
@Test @SuppressWarnings("unchecked") public void testAddInputClause() { setupGrid(makeHasNameForDecision(), 0); addInputClause(1); verifyCommandExecuteOperation(BaseExpressionGrid.RESIZE_EXISTING); verify(grid).selectHeaderCell(eq(0), eq(1), eq(false), eq(false)); verifyEditHeaderCell(InputClauseColumnHeaderMetaData.class, 0, 1); reset(gridPanel, gridLayer, grid, parentGridColumn); verify(sessionCommandManager).execute(eq(canvasHandler), addInputClauseCommandCaptor.capture()); addInputClauseCommandCaptor.getValue().undo(canvasHandler); verifyCommandUndoOperation(BaseExpressionGrid.RESIZE_EXISTING_MINIMUM); }
@Test public void testMultipleInputClauseColumnHeaderEditorInstances() { final ValueAndDataTypePopoverView.Presenter headerEditor2 = mock(ValueAndDataTypePopoverView.Presenter.class); when(headerEditors.get()).thenReturn(headerEditor, headerEditor2); setupGrid(makeHasNameForDecision(), 0); addInputClause(2); reset(headerEditor2); final GridColumn uiColumn1 = grid.getModel().getColumns().get(1); assertInputClauseColumnHeaderEditor(uiColumn1, headerEditor); final GridColumn uiColumn2 = grid.getModel().getColumns().get(2); assertInputClauseColumnHeaderEditor(uiColumn2, headerEditor2); }