### Question:
CaseManagementSetChildNodeCanvasCommand extends org.kie.workbench.common.stunner.core.client.canvas.command.SetCanvasChildrenCommand { @Override public CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context) { if (!(originalParent.isPresent() && originalIndex.isPresent())) { return new RemoveCanvasChildrenCommand(getParent(), getCandidate()).execute(context); } else { context.addChild(originalParent.get(), getCandidate(), originalIndex.getAsInt()); context.updateElementProperties(getCandidate(), MutationContext.STATIC); } return buildResult(); } @SuppressWarnings("unchecked")  CaseManagementSetChildNodeCanvasCommand(final Node<View<?>, Edge> parent,
                                                   final Node<View<?>, Edge> child,
                                                   final OptionalInt index,
                                                   final Optional<Node<View<?>, Edge>> originalParent,
                                                   final OptionalInt originalIndex); @Override CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context);  }### Answer:
@Test public void checkUndo() { final CaseManagementSetChildNodeCanvasCommand command = setChildNode(parent, candidate, index, originalParent, originalIndex); command.undo(canvasHandler); verify(canvasHandler).removeChild(eq(parent), eq(candidate)); }