@Test
public void testFindAllPaths() {

    graph.addVertex();
    graph.addVertex();
    graph.addVertex();
    graph.addVertex();
    graph.addVertex();
    graph.addVertex();
    graph.setVertexObject(5, new Vertex("end"));
    graph.addEdge(0, 1, null); // 0
    graph.addEdge(0, 2, null); // 1
    graph.addEdge(0, 3, null); // 2
    graph.addEdge(1, 4, null); // 3
    graph.addEdge(2, 4, null); // 4
    graph.addEdge(4, 5, null); // 5
    graph.addEdge(3, 5, null); // 6
    List<TIntArrayList> paths = graph.findAllPaths(0, vertex -> vertex != null && "end".equals(vertex.name), null);
    assertEquals(3, paths.size());
    assertArrayEquals(paths.get(0).toArray(), new int[] {2, 6});
    assertArrayEquals(paths.get(1).toArray(), new int[] {0, 3, 5});
    assertArrayEquals(paths.get(2).toArray(), new int[] {1, 4, 5});
}