@Test
    public void testToConnectionMapCsvOnCompleteArm() {
        Mass shoulder = new Mass(0, 1, SHOULDER);
        Mass upperArm = new Mass(0, 1, ARM_SEGMENT);
        Mass shoulderInput = new Mass(0, 2, INPUT);
        Mass elbowUpperArmInput = new Mass(0, 10, INPUT);
        Mass elbow = new Mass(0, 11, ELBOW);
        Mass lowerArm = new Mass(0, 11, ARM_SEGMENT);
        Mass elbowLowerArmInput = new Mass(0, 12, INPUT);
        Mass handInput = new Mass(0, 20, INPUT);
        Mass hand = new Mass(0, 21, HAND);

        graph.addMasses(shoulder); // index 0
        graph.addMasses(upperArm); // index 1
        graph.addMasses(shoulderInput); // index 2
        graph.addMasses(elbowUpperArmInput); // index 3
        graph.addMasses(elbow); // index 4
        graph.addMasses(lowerArm); // index 5
        graph.addMasses(elbowLowerArmInput); // index 6
        graph.addMasses(handInput); // index 7
        graph.addMasses(hand); // index 8

        graph.addSpring(shoulder, upperArm);
        graph.addSpring(upperArm, shoulderInput);
        graph.addSpring(upperArm, elbowUpperArmInput);
        graph.addSpring(upperArm, lowerArm);
        graph.addSpring(lowerArm, elbowLowerArmInput);
        graph.addSpring(lowerArm, handInput);
        graph.addSpring(lowerArm, hand);

        result = GraphConverter.toConnectionMapCsv(graph);
        assertEquals(CONNECTION_MAP_PREAMBLE
                + "1,0,6\n"
                + "2,1,5\n"
                + "3,1,5\n"
                + "5,1,7\n"
                + "6,5,5\n"
                + "7,5,5\n"
                + "8,5,5\n",
                result);

        // Reversed springs
        graph.springs.clear();

        graph.addSpring(upperArm, shoulder);
        graph.addSpring(shoulderInput, upperArm);
        graph.addSpring(elbowUpperArmInput, upperArm);
        graph.addSpring(lowerArm, upperArm);
        graph.addSpring(elbowLowerArmInput, lowerArm);
        graph.addSpring(handInput, lowerArm);
        graph.addSpring(hand, lowerArm);

        result = GraphConverter.toConnectionMapCsv(graph);
        assertEquals(CONNECTION_MAP_PREAMBLE
                + "1,0,6\n"
                + "2,1,5\n"
                + "3,1,5\n"
                + "5,1,7\n"
                + "6,5,5\n"
                + "7,5,5\n"
                + "8,5,5\n",
                result);
    }