@Test
    @LoadGraphWith(MODERN)
    public void shouldFindInDirectedShortestPaths() throws Exception {
        final List<ShortestPathVertexProgram> programs = Arrays.asList(
                ShortestPathVertexProgram.build().edgeTraversal(__.inE()).create(graph),
                ShortestPathVertexProgram.build().edgeDirection(Direction.IN).create(graph));
        for (final ShortestPathVertexProgram program : programs) {
            final ComputerResult result = graph.compute(graphProvider.getGraphComputer(graph).getClass()).
                    program(program).submit().get();
            assertTrue(result.memory().exists(ShortestPathVertexProgram.SHORTEST_PATHS));
            final List<Path> shortestPaths = result.memory().get(ShortestPathVertexProgram.SHORTEST_PATHS);
            final List<Path> expected = Arrays.stream(ALL_SHORTEST_PATHS)
                    .filter(p -> (p[0].equals("marko") && p.length == 1)
                            || (p[0].equals("vadas") && Arrays.asList("marko", "vadas").contains(p[p.length - 1]))
                            || (p[0].equals("lop") && Arrays.asList("marko", "lop", "josh", "peter").contains(p[p.length - 1]))
                            || (p[0].equals("josh") && Arrays.asList("marko", "josh").contains(p[p.length - 1]))
                            || (p[0].equals("ripple") && Arrays.asList("marko", "josh", "ripple").contains(p[p.length - 1]))
                            || (p[0].equals("peter") && p.length == 1))
                    .map(helper::makePath).collect(Collectors.toList());
            helper.checkResults(expected, shortestPaths);
        }
    }
@author Daniel Kuppitz (http://gremlin.guru)
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/search/path/ShortestPathVertexProgramTest.java