title: What next() means in TinkerPop
body: <p>I'm currently reading the TinkerPop3 <a href="http://tinkerpop.incubator.apache.org/docs/3.0.1-incubating/" rel="noreferrer">Documentation</a></p>
  
  <p>What I'm confused is that I can't find any explanation about <code>next()</code>.</p>
  
  <p>For example, w/ next() or w/o next() returns same vertext</p>
  
  <pre><code>gremlin&gt; g.V().has('name', 'marko')
  ==&gt;v[1]
  gremlin&gt; g.V().has('name', 'marko').next()
  ==&gt;v[1]
  </code></pre>
  
  <p>but, the class names are different from each other.</p>
  
  <pre><code>gremlin&gt; g.V().has('name', 'marko').getClass()
  ==&gt;class org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal
  gremlin&gt; g.V().has('name', 'marko').next().getClass()
  ==&gt;class org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertex
  </code></pre>
  
  <p>Without 'next()' an assigned variable has no value.</p>
  
  <pre><code>gremlin&gt; marko = g.V().has('name', 'marko')
  ==&gt;v[1]
  gremlin&gt; marko
  </code></pre>
  
  <p>Even, with <code>clockWithResult()</code> the outputs are completely different.</p>
  
  <pre><code>gremlin&gt; clockWithResult(1){g.V().both().barrier().both().barrier().both().barrier().count().next()}
  ==&gt;1.079524
  ==&gt;72
  gremlin&gt; clockWithResult(1){g.V().both().barrier().both().barrier().both().barrier().count()}
  ==&gt;0.11863599999999999
  ==&gt;[GraphStep([],vertex), VertexStep(BOTH,vertex), NoOpBarrierStep(2147483647), VertexStep(BOTH,vertex), NoOpBarrierStep(2147483647), VertexStep(BOTH,vertex), NoOpBarrierStep(2147483647), CountGlobalStep]
  </code></pre>
  
  <p>or this example:</p>
  
  <pre><code>gremlin&gt; g.V(1).out('knows').values('name').fold()
  ==&gt;[vadas, josh]
  gremlin&gt; g.V(1).out('knows').values('name').fold().next()
  ==&gt;vadas
  ==&gt;josh
  </code></pre>
  
  <p>In the manual, there are many other examples which make me confusing.</p>
  
  <p>I hope marko and his friends would help me.</p>