### Question:
CaseManagementAddChildNodeCanvasCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context) { return new CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation>() .addCommand(new CaseManagementDeleteCanvasNodeCommand(child, parent, index)) .build() .execute(context); } CaseManagementAddChildNodeCanvasCommand(final Node parent,
                                                   final Node child,
                                                   final String shapeSetId,
                                                   final int index); @Override CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context);  }### Answer:
@Test public void checkUndo() { final CaseManagementAddChildNodeCanvasCommand command = addChildNode(); command.undo(canvasHandler); verify(canvasHandler).removeChild(eq(parent), eq(candidate)); verify(canvasHandler).deregister(eq(candidate)); }