public Iterator<Edge> legalEdges(final Vertex vertex) {
        return null == this.edgeFilter ?
                vertex.edges(Direction.BOTH) :
                TraversalUtil.applyAll(vertex, this.edgeFilter);
    }
Returns an iterator of legal edges incident to the provided vertex.
If no edge filter is provided, then all incident edges are returned.

@param vertex the vertex whose legal edges are to be access.
@return an iterator of edges that are {@link Legal#YES}.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphFilter.java