### Question:
DeleteContextEntryCommand extends AbstractCanvasGraphCommand implements VetoExecutionCommand,
                                                                                     VetoUndoCommand { @Override protected Command<AbstractCanvasHandler, CanvasViolation> newCanvasCommand(final AbstractCanvasHandler handler) { return new AbstractCanvasCommand() { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler handler) { uiModel.deleteRow(uiRowIndex); updateRowNumbers(); updateParentInformation(); canvasOperation.execute(); return CanvasCommandResultBuilder.SUCCESS; } @Override public CommandResult<CanvasViolation> undo(final AbstractCanvasHandler handler) { uiModel.insertRow(uiRowIndex, oldUiModelRow); updateRowNumbers(); updateParentInformation(); canvasOperation.execute(); return CanvasCommandResultBuilder.SUCCESS; } }; } DeleteContextEntryCommand(final Context context,
                                     final GridData uiModel,
                                     final int uiRowIndex,
                                     final org.uberfire.mvp.Command canvasOperation); void updateRowNumbers(); void updateParentInformation();  }### Answer:
@Test public void testCanvasCommandAllow() { makeCommand(0); final Command<AbstractCanvasHandler, CanvasViolation> c = command.newCanvasCommand(handler); assertEquals(CanvasCommandResultBuilder.SUCCESS, c.allow(handler)); }
@Test public void testCanvasCommandExecuteRowNumbering() { makeCommand(0); setupRowNumbers(); command.newCanvasCommand(handler).execute(handler); assertEquals(2, uiModel.getRowCount()); assertEquals(1, uiModel.getCell(0, 0).getValue().getValue()); assertNull(uiModel.getCell(1, 0).getValue()); }
@Test public void testCanvasCommandUndoRowNumbering() { makeCommand(0); setupRowNumbers(); command.newCanvasCommand(handler).execute(handler); command.newCanvasCommand(handler).undo(handler); assertEquals(3, uiModel.getRowCount()); assertEquals(1, uiModel.getCell(0, 0).getValue().getValue()); assertEquals(2, uiModel.getCell(1, 0).getValue().getValue()); assertNull(uiModel.getCell(2, 0).getValue()); }