@Test
    public void testGetIndex() {
        graph.addMasses(mass);
        assertEquals(0, mass.getIndex(graph));

        graph.addMasses(new Mass(X + 1, Y + 1));
        assertEquals(0, mass.getIndex(graph)); // should not affect this

        graph.getMasses().add(0, new Mass(X + 2, Y + 2));
        assertEquals(1, mass.getIndex(graph)); // should affect this

    }