### Question:
UpdateCanvasControlPointPositionCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> allow(final AbstractCanvasHandler context) { ControlPointValidations.checkUpdateControlPoint(getControlPoints(edge), controlPoints); return CanvasCommandResultBuilder.SUCCESS; } UpdateCanvasControlPointPositionCommand(final Edge edge,
                                                   final ControlPoint[] controlPoints); @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 public void testCheck() { tested = new UpdateCanvasControlPointPositionCommand(edge, newControlPoints); CommandResult<CanvasViolation> result = tested.allow(canvasHandler); assertFalse(CommandUtils.isError(result)); }
@Test(expected = IllegalArgumentException.class) public void testCannotUpdateCPs() { newControlPoints = new ControlPoint[]{newControlPoint1, newControlPoint2}; tested = new UpdateCanvasControlPointPositionCommand(edge, newControlPoints); tested.allow(canvasHandler); }
@Test(expected = IllegalArgumentException.class) public void testCannotUpdateCPs2() { viewConnector.setControlPoints(new ControlPoint[]{controlPoint1, controlPoint2}); tested = new UpdateCanvasControlPointPositionCommand(edge, newControlPoints); tested.allow(canvasHandler); }