### Question:
CloneConnectorCommand extends AbstractCanvasGraphCommand { @Override protected Command<AbstractCanvasHandler, CanvasViolation> newCanvasCommand(final AbstractCanvasHandler context) { return command; } CloneConnectorCommand(final Edge candidate,
                                 final String sourceUUID,
                                 final String targetUUID,
                                 final String shapeSetId,
                                 final Consumer<Edge> callback); @Override String toString();  }### Answer:
@Test @SuppressWarnings("unchecked") public void newCanvasCommand() { Command<AbstractCanvasHandler, CanvasViolation> command = cloneConnectorCommand.newCanvasCommand(context); assertTrue(command instanceof CompositeCommand); Consumer<Edge> cloneCallback = cloneConnectorCommand.getCloneCallback(); cloneCallback.accept(clone); CompositeCommand compositeCommand = (CompositeCommand) command; assertTrue(compositeCommand.getCommands().stream().anyMatch(c -> c instanceof AddCanvasConnectorCommand)); assertEquals(((AddCanvasConnectorCommand) compositeCommand.getCommands().stream() .filter(c -> c instanceof AddCanvasConnectorCommand) .findFirst() .get()).getCandidate(), clone); assertTrue(compositeCommand.getCommands().stream().anyMatch(c -> c instanceof SetCanvasConnectionCommand)); assertEquals(((SetCanvasConnectionCommand) compositeCommand.getCommands().stream() .filter(c -> c instanceof SetCanvasConnectionCommand) .findFirst() .get()).getEdge(), clone); }