private void assertMassesToConstraint(double x1, double y1, Type type1, double x2, double y2, Type type2, ConnectionType expectedSpringType) {
        mass1 = new Mass(x1, y1, type1);
        mass2 = new Mass(x2, y2, type2);
        spring = new Spring(graph, mass1, mass2);
        assertEquals(expectedSpringType, spring.connectionType);
        spring = new Spring(graph, mass2, mass1);
        assertEquals(expectedSpringType, spring.connectionType);
    }