code: public <T> DataSet<T> groupReduceOnEdges(EdgesFunctionWithVertexValue<K, VV, EV, T> edgesFunction,
  			EdgeDirection direction) throws IllegalArgumentException {
  
  		switch (direction) {
  		case IN:
  			return vertices.coGroup(edges).where(0).equalTo(1)
  					.with(new ApplyCoGroupFunction<>(edgesFunction)).name("GroupReduce on in-edges");
  		case OUT:
  			return vertices.coGroup(edges).where(0).equalTo(0)
  					.with(new ApplyCoGroupFunction<>(edgesFunction)).name("GroupReduce on out-edges");
  		case ALL:
  			return vertices.coGroup(edges.flatMap(new EmitOneEdgePerNode<>())
  						.name("Emit edge"))
  					.where(0).equalTo(0).with(new ApplyCoGroupFunctionOnAllEdges<>(edgesFunction))
  						.name("GroupReduce on in- and out-edges");
  		default:
  			throw new IllegalArgumentException("Illegal edge direction");
  		}
  	}
docs: Groups by vertex and computes a GroupReduce transformation over the edge values of each vertex.
  The edgesFunction applied on the edges has access to both the id and the value
  of the grouping vertex.
  
  <p>For each vertex, the edgesFunction can iterate over all edges of this vertex
  with the specified direction, and emit any number of output elements, including none.
  
  @param edgesFunction the group reduce function to apply to the neighboring edges of each vertex.
  @param direction the edge direction (in-, out-, all-).
  @param <T> the output type
  @return a DataSet containing elements of type T
  @throws IllegalArgumentException