@Override
    public void writeGraphRDD(final Configuration configuration, final JavaPairRDD<Object, VertexWritable> graphRDD) {
        int totalAge = 0;
        final Iterator<VertexWritable> iterator = graphRDD.values().collect().iterator();
        while (iterator.hasNext()) {
            final Vertex vertex = iterator.next().get();
            if (vertex.label().equals("person"))
                totalAge = totalAge + vertex.<Integer>value("age");
        }
        assertEquals(123, totalAge);
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/ExampleOutputRDD.java