@Override
    protected Traverser.Admin<Long> processNextStart() throws NoSuchElementException {
        if (!this.done) {
            this.done = true;
            final AbstractTinkerGraph graph = (AbstractTinkerGraph) this.getTraversal().getGraph().get();
            return this.getTraversal().getTraverserGenerator().generate(Vertex.class.isAssignableFrom(this.elementClass) ?
                            (long) graph.getVerticesCount() :
                            (long) graph.getEdgesCount(),
                    (Step) this, 1L);
        } else
            throw FastNoSuchElementException.instance();
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/map/TinkerCountGlobalStep.java