// Path: api/src/test/java/de/tesis/dynaware/grapheditor/utils/FXTestUtils.java
// public static void dragBy(final Node node, final double dx, final double dy) {
//     dragTo(node, node.getLayoutX() + dx, node.getLayoutY() + dy);
// }
// 
// Path: api/src/test/java/de/tesis/dynaware/grapheditor/utils/FXTestUtils.java
// public static void dragTo(final Node node, final double endX, final double endY) {
//     dragTo(node, 0, 0, endX, endY);
// }
// 
// Path: api/src/test/java/de/tesis/dynaware/grapheditor/utils/FXTestUtils.java
// public static void forceLayoutUpdate(final Parent parent) {
//     parent.autosize();
//     parent.snapshot(null, null);
//     parent.layout();
// }
// 
// Path: api/src/main/java/de/tesis/dynaware/grapheditor/EditorElement.java
// public enum EditorElement
// {
//     CONNECTOR,
//     NODE,
//     JOINT;
// }


import static de.tesis.dynaware.grapheditor.utils.FXTestUtils.dragBy;
import static de.tesis.dynaware.grapheditor.utils.FXTestUtils.dragTo;
import static de.tesis.dynaware.grapheditor.utils.FXTestUtils.forceLayoutUpdate;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import de.tesis.dynaware.grapheditor.EditorElement;
import javafx.scene.layout.Pane;

        final double y = box.getLayoutY();

        assertTrue(x == Math.round(x / GRID_SPACING) * GRID_SPACING);
        assertTrue(y == Math.round(y / GRID_SPACING) * GRID_SPACING);
    }

    @Test
    public void testDrag_AlignmentTargets() {

        final double[] alignmentTargetsX = new double[] {67.0};
        final double[] alignmentTargetsY = new double[] {184.0};

        box.setAlignmentThreshold(ALIGNMENT_THRESHOLD);
        box.setAlignmentTargetsX(alignmentTargetsX);
        box.setAlignmentTargetsY(alignmentTargetsY);

        dragTo(box, 40 + BOX_WIDTH / 2, 0);
        assertTrue(box.getLayoutX() == 67.0);

        dragTo(box, 0, 170 + BOX_HEIGHT / 2);
        assertTrue(box.getLayoutY() == 184.0);
    }

    /**
     * Asserts that the box's layout X and Y values are at the given positions.
     *
     * @param x the x value that the box should have
     * @param y the y value that the box should have
     */
    private void assertAt(final double x, final double y) {

// Path: api/src/test/java/de/tesis/dynaware/grapheditor/utils/FXTestUtils.java
// public static void dragBy(final Node node, final double dx, final double dy) {
//     dragTo(node, node.getLayoutX() + dx, node.getLayoutY() + dy);
// }
// 
// Path: api/src/test/java/de/tesis/dynaware/grapheditor/utils/FXTestUtils.java
// public static void dragTo(final Node node, final double endX, final double endY) {
//     dragTo(node, 0, 0, endX, endY);
// }
// 
// Path: api/src/test/java/de/tesis/dynaware/grapheditor/utils/FXTestUtils.java
// public static void forceLayoutUpdate(final Parent parent) {
//     parent.autosize();
//     parent.snapshot(null, null);
//     parent.layout();
// }
// 
// Path: api/src/main/java/de/tesis/dynaware/grapheditor/EditorElement.java
// public enum EditorElement
// {
//     CONNECTOR,
//     NODE,
//     JOINT;
// }


// Path: api/src/test/java/de/tesis/dynaware/grapheditor/utils/DraggableBoxTest.java
import static de.tesis.dynaware.grapheditor.utils.FXTestUtils.dragBy;
import static de.tesis.dynaware.grapheditor.utils.FXTestUtils.dragTo;
import static de.tesis.dynaware.grapheditor.utils.FXTestUtils.forceLayoutUpdate;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import de.tesis.dynaware.grapheditor.EditorElement;
import javafx.scene.layout.Pane;

        final double y = box.getLayoutY();

        assertTrue(x == Math.round(x / GRID_SPACING) * GRID_SPACING);
        assertTrue(y == Math.round(y / GRID_SPACING) * GRID_SPACING);
    }

    @Test
    public void testDrag_AlignmentTargets() {

        final double[] alignmentTargetsX = new double[] {67.0};
        final double[] alignmentTargetsY = new double[] {184.0};

        box.setAlignmentThreshold(ALIGNMENT_THRESHOLD);
        box.setAlignmentTargetsX(alignmentTargetsX);
        box.setAlignmentTargetsY(alignmentTargetsY);

        dragTo(box, 40 + BOX_WIDTH / 2, 0);
        assertTrue(box.getLayoutX() == 67.0);

        dragTo(box, 0, 170 + BOX_HEIGHT / 2);
        assertTrue(box.getLayoutY() == 184.0);
    }

    /**
     * Asserts that the box's layout X and Y values are at the given positions.
     *
     * @param x the x value that the box should have
     * @param y the y value that the box should have
     */
    private void assertAt(final double x, final double y) {

        forceLayoutUpdate(container);
