### Question:
SetConnectionTargetNodeCommand extends AbstractGraphCommand { @SuppressWarnings("unchecked") private Node<? extends View<?>, Edge> getTargetNode(final GraphCommandExecutionContext context) { if (null == targetNode) { targetNode = (Node<? extends View<?>, Edge>) getNode(context, targetNodeUUID); } return targetNode; } @SuppressWarnings("unchecked")  SetConnectionTargetNodeCommand(final @MapsTo("targetNodeUUID") String targetNodeUUID,
                                          final @MapsTo("edgeUUID") String edgeUUID,
                                          final @MapsTo("magnet") Connection connection); @SuppressWarnings("unchecked")  SetConnectionTargetNodeCommand(final Node<? extends View<?>, Edge> targetNode,
                                          final Edge<? extends View, Node> edge,
                                          final Connection connection); @SuppressWarnings("unchecked")  SetConnectionTargetNodeCommand(final Node<? extends View<?>, Edge> targetNode,
                                          final Edge<? extends View, Node> edge); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); Edge<? extends View, Node> getEdge(); Connection getConnection(); Node<? extends View<?>, Edge> getTargetNode(); Node<? extends View<?>, Edge> getSourceNode(); @Override String toString();  }### Answer:
@Test @SuppressWarnings("unchecked") public void testSkipRulesForSameTargetNodeAsBefore() { when(edge.getTargetNode()).thenReturn(node); CommandResult<RuleViolation> result = tested.allow(graphCommandExecutionContext); assertEquals(CommandResult.Type.INFO, result.getType()); verify(ruleManager, times(0)).evaluate(eq(ruleSet), any(RuleEvaluationContext.class)); }