@Test
    public void shouldOnlyAllowEdgeFilterToTraverseLocalStarGraph() {
        GraphFilter graphFilter = new GraphFilter();
        graphFilter.setEdgeFilter(__.outE());
        try {
            graphFilter.setEdgeFilter(__.<Vertex>outE().inV().outE());
            fail("Should not allow traversals past the star graph");
        } catch (final IllegalArgumentException e) {
            assertEquals(e.getMessage(), GraphComputer.Exceptions.edgeFilterAccessesAdjacentVertices(__.<Vertex>outE().inV().outE()).getMessage());
        }
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/computer/GraphFilterTest.java