### Question:
DeleteParameterBindingCommand extends AbstractCanvasGraphCommand implements VetoExecutionCommand,
                                                                                         VetoUndoCommand { @Override protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler handler) { return new AbstractGraphCommand() { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext gce) { return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext gce) { invocation.getBinding().remove(uiRowIndex); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { invocation.getBinding().add(uiRowIndex, oldParameterBinding); return GraphCommandResultBuilder.SUCCESS; } }; } DeleteParameterBindingCommand(final Invocation invocation,
                                         final GridData uiModel,
                                         final int uiRowIndex,
                                         final org.uberfire.mvp.Command canvasOperation); void updateRowNumbers(); void updateParentInformation();  }### Answer:
@Test public void testGraphCommandAllow() { makeCommand(0); final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler); assertEquals(GraphCommandResultBuilder.SUCCESS, c.allow(gce)); }
@Test public void testGraphCommandExecute() { makeCommand(0); final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler); assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce)); assertEquals(0, invocation.getBinding().size()); }
@Test public void testGraphCommandExecuteRemoveFromMiddle() { final Binding firstBinding = new Binding(); final Binding lastBinding = new Binding(); invocation.getBinding().add(0, firstBinding); invocation.getBinding().add(lastBinding); uiModel.appendRow(new BaseGridRow()); uiModel.appendRow(new BaseGridRow()); makeCommand(1); final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler); assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce)); Assertions.assertThat(invocation.getBinding()).containsExactly(firstBinding, lastBinding); }
@Test public void testGraphCommandUndo() { makeCommand(0); final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler); assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce)); assertEquals(GraphCommandResultBuilder.SUCCESS, c.undo(gce)); assertEquals(1, invocation.getBinding().size()); assertEquals(binding, invocation.getBinding().get(0)); }