### Question:
UndefinedExpressionColumn extends DMNGridColumn<UndefinedExpressionGrid, String> { @Override @SuppressWarnings("unchecked") public void edit(final GridCell<String> cell, final GridBodyCellEditContext context, final Consumer<GridCellValue<String>> callback) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); undefinedExpressionSelector.bind(gridWidget, uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX, absoluteCellY}; final Optional<com.ait.lienzo.client.core.types.Point2D> rx = context.getRelativeLocation(); if (!rx.isPresent()) { dxy[0] += gridWidget.getWidth() / 2.0; dxy[1] += gridWidget.getHeight() / 2.0; } else { dxy[0] = rx.get().getX(); dxy[1] = rx.get().getY(); } cellEditorControls.show(undefinedExpressionSelector, (int) (dxy[0]), (int) (dxy[1])); } UndefinedExpressionColumn(final double width,
                                     final UndefinedExpressionGrid gridWidget,
                                     final CellEditorControlsView.Presenter cellEditorControls,
                                     final UndefinedExpressionSelectorPopoverView.Presenter undefinedExpressionSelector);  UndefinedExpressionColumn(final List<HeaderMetaData> headerMetaData,
                                     final double width,
                                     final UndefinedExpressionGrid gridWidget,
                                     final CellEditorControlsView.Presenter cellEditorControls,
                                     final UndefinedExpressionSelectorPopoverView.Presenter undefinedExpressionSelector); @Override @SuppressWarnings("unchecked") void edit(final GridCell<String> cell,
                     final GridBodyCellEditContext context,
                     final Consumer<GridCellValue<String>> callback); @Override void setWidth(final double width); @Override void destroyResources(); static final double DEFAULT_WIDTH; }### Answer:
@Test @SuppressWarnings("unchecked") public void testEditWithDefinedCellEditor() { final UndefinedExpressionCell cell = mock(UndefinedExpressionCell.class); column.edit(cell, context, callback); verify(undefinedExpressionSelector).bind(eq(gridWidget), eq(ROW_INDEX), eq(COLUMN_INDEX)); verify(cellEditorControls).show(eq(undefinedExpressionSelector), eq(0), eq(0)); }
@Test @SuppressWarnings("unchecked") public void testEditWithDefinedCellEditorWithRelativeLocation() { final UndefinedExpressionCell cell = mock(UndefinedExpressionCell.class); when(relativeLocation.getX()).thenReturn(RX); when(relativeLocation.getY()).thenReturn(RY); column.edit(cell, context, callback); verify(undefinedExpressionSelector).bind(eq(gridWidget), eq(ROW_INDEX), eq(COLUMN_INDEX)); verify(cellEditorControls).show(eq(undefinedExpressionSelector), eq((int) (RX)), eq((int) (RY))); }
@Test @SuppressWarnings("unchecked") public void testEditWithDefinedCellEditorWithoutRelativeLocation() { final UndefinedExpressionCell cell = mock(UndefinedExpressionCell.class); when(context.getRelativeLocation()).thenReturn(Optional.empty()); column.edit(cell, context, callback); verify(undefinedExpressionSelector).bind(eq(gridWidget), eq(ROW_INDEX), eq(COLUMN_INDEX)); verify(cellEditorControls).show(eq(undefinedExpressionSelector), eq((int) (ABSOLUTE_CELL_X + GRID_WIDTH / 2)), eq((int) (ABSOLUTE_CELL_Y + GRID_HEIGHT / 2))); }