### Question:
ConnectionAcceptorControlImpl extends AbstractAcceptorControl implements ConnectionAcceptorControl<AbstractCanvasHandler> { @Override @SuppressWarnings("unchecked") public boolean allowTarget(final Node target, final Edge<ViewConnector<?>, Node> connector, final Connection connection) { if (isTargetConnectionChanged(connector, connection)) { final CommandResult<CanvasViolation> violations = getCommandManager().allow(getCanvasHandler(), canvasCommandFactory.setTargetNode(target, connector, connection)); final boolean accepts = isAccept(violations); if (isTargetChanged(target, connector)) { highlight(target, connector, accepts); } return accepts; } return true; } @Inject  ConnectionAcceptorControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory,
                                         final CanvasHighlight canvasHighlight); @Override @SuppressWarnings("unchecked") boolean allowSource(final Node source,
                               final Edge<ViewConnector<?>, Node> connector,
                               final Connection connection); @Override @SuppressWarnings("unchecked") boolean allowTarget(final Node target,
                               final Edge<ViewConnector<?>, Node> connector,
                               final Connection connection); @Override @SuppressWarnings("unchecked") boolean acceptSource(final Node source,
                                final Edge<ViewConnector<?>, Node> connector,
                                final Connection connection); @Override @SuppressWarnings("unchecked") boolean acceptTarget(final Node target,
                                final Edge<ViewConnector<?>, Node> connector,
                                final Connection connection); static Connection createConnection(final WiresConnection wiresConnection,
                                              final WiresMagnet wiresMagnet); @SuppressWarnings("unchecked") static MagnetConnection createConnection(final Element element);  }### Answer:
@Test public void testAllowTarget() { tested.init(canvasHandler); final boolean allow = tested.allowTarget(node, edge, connection); assertTrue(allow); verify(commandManager, times(1)).allow(eq(canvasHandler), eq(setConnectionTargetNodeCommand)); verify(commandManager, never()).execute(any(AbstractCanvasHandler.class), any(SetConnectionTargetNodeCommand.class)); assertEquals(node, setConnectionTargetNodeCommand.getNode()); assertEquals(edge, setConnectionTargetNodeCommand.getEdge()); assertEquals(connection, setConnectionTargetNodeCommand.getConnection()); verify(highlight, times(1)).unhighLight(); }