### Question:
AddCanvasChildNodeCommand extends AbstractRegistrationCanvasNodeCommand { @Override @SuppressWarnings("unchecked") public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { final CommandResult<CanvasViolation> result = super.execute(context); context.applyElementMutation(parent, MutationContext.STATIC); return result; } AddCanvasChildNodeCommand(final Node parent,
                                     final Node candidate,
                                     final String shapeSetId); @Override @SuppressWarnings("unchecked") CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context); @Override @SuppressWarnings("unchecked") CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context); Node getParent(); @Override String toString();  }### Answer:
@Test @SuppressWarnings("unchecked") public void testExecute() { final CommandResult<CanvasViolation> result = tested.execute(canvasHandler); assertNotEquals(CommandResult.Type.ERROR, result.getType()); verify(canvasHandler, times(1)).register(eq(SHAPE_SET_ID), eq(candidate)); verify(canvasHandler, times(1)).addChild(eq(parent), eq(candidate)); verify(canvasHandler, times(1)).applyElementMutation(eq(candidate), any(MutationContext.class)); verify(canvasHandler, times(1)).applyElementMutation(eq(parent), any(MutationContext.class)); }