### Question:
BPMNCreateNodeAction extends GeneralCreateNodeAction { public static boolean isAutoMagnetConnection(final Node<View<?>, Edge> sourceNode, final Node<View<?>, Edge> targetNode) { final Object sourceDefinition = null != sourceNode ? sourceNode.getContent().getDefinition() : null; final Object targetDefinition = null != targetNode ? targetNode.getContent().getDefinition() : null; final boolean isSourceGateway = isGateway(sourceDefinition); final boolean isTargetGateway = isGateway(targetDefinition); return !(isSourceGateway || isTargetGateway); } @Inject  BPMNCreateNodeAction(final DefinitionUtils definitionUtils,
                                final ClientFactoryManager clientFactoryManager,
                                final CanvasLayoutUtils canvasLayoutUtils,
                                final Event<CanvasSelectionEvent> selectionEvent,
                                final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                                final @Any ManagedInstance<DefaultCanvasCommandFactory> canvasCommandFactories); static boolean isAutoMagnetConnection(final Node<View<?>, Edge> sourceNode,
                                                 final Node<View<?>, Edge> targetNode);  }### Answer:
@Test @SuppressWarnings("unchecked") public void testIsAutoConnection() { assertFalse(isAutoMagnetConnection(gatewayNode, taskNode)); assertFalse(isAutoMagnetConnection(gatewayNode, eventNode)); assertFalse(isAutoMagnetConnection(taskNode, gatewayNode)); assertFalse(isAutoMagnetConnection(eventNode, gatewayNode)); assertFalse(isAutoMagnetConnection(gatewayNode, gatewayNode)); assertTrue(isAutoMagnetConnection(taskNode, taskNode)); assertTrue(isAutoMagnetConnection(eventNode, taskNode)); assertTrue(isAutoMagnetConnection(taskNode, eventNode)); assertTrue(isAutoMagnetConnection(eventNode, eventNode)); }