### Question:
DeleteCanvasControlPointCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { allow(context); consumeControlPoints(context, candidate, view -> { this.deletedControlPoint = view.getManageableControlPoints()[index]; view.deleteControlPoint(index); }); return buildResult(); } DeleteCanvasControlPointCommand(final Edge candidate,
                                           final int index); @Override CommandResult<CanvasViolation> allow(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context); @Override String toString();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testInvalidIndexDuringExecute() { tested = new DeleteCanvasControlPointCommand(edge, -1); tested.execute(canvasHandler); }
@Test(expected = IllegalArgumentException.class) public void testIndexForbiddenDuringExecute() { tested = new DeleteCanvasControlPointCommand(edge, 3); tested.execute(canvasHandler); }