@Test
    public void testCalculate() throws Exception {
        List<Vertex> vertices = createvertices();

        FloydWarshallResult result = new FloydWarshall().calculate(vertices);

        String distance = createMatrixText(result.getDistance());
        assertThat(distance,
            is("[0,2,5,10,4]\r\n" +
                "[16,0,3,8,4]\r\n" +
                "[13,15,0,5,1]\r\n" +
                "[8,10,13,0,12]\r\n" +
                "[15,17,20,7,0]\r\n"));

        String pred = createMatrixText(result.getPred());
        assertThat(pred,
            is("[-1,0,1,2,0]\r\n" +
                "[3,-1,1,2,2]\r\n" +
                "[3,0,-1,2,2]\r\n" +
                "[3,0,1,-1,0]\r\n" +
                "[3,0,1,4,-1]\r\n"));
    }