anchor.diff:  
   [gremlin-groovy,modern]
   ----
  -sg = g.E().hasLabel('knows').subgraph().next() <1>
  +sg = g.E().hasLabel('knows').subgraph('sg').cap('sg').next() <1>
   sg.E() <2>
   ----
   
  
positive.code: image::tree-step2.png[width=500]
  
  The resultant tree data structure can then be manipulated (see link:http://www.tinkerpop.com/javadocs/current/org/apache/tinkerpop/gremlin/process/graph/step/util/Tree.html[Tree JavaDoc]). For the sake of demonstration, a post-processing lambda is applied in the running example below.
  
  [gremlin-groovy,modern]
  ----
  tree = g.V().out().out().tree().by('name').next()
  tree['marko']
  tree['marko']['josh']
  tree.getObjectsAtDepth(3)
  ----
  
  [[unfold-step]]
  Unfold Step
  
negative.code: g.V().repeat(both().groupCount('m').by(label)).times(10).cap('m')
  ----
  
  The above is interesting in that it demonstrates the use of referencing the internal `Map<Object,Long>` of `groupCount()` with a string variable. Given that `groupCount()` is a sideEffect-step, it simply passes the object it received to its output. Internal to `groupCount()`, the object's count is incremented.
  
  WARNING: The `groupCount()`-step does not have a correlate in <<traversalvertexprogram,Gremlin OLAP>> when used mid-traversal. When in mid-traversal grouping only occurs at the the current processing vertex and thus, is not a global operation as it in Gremlin OLTP. However, `GroupCountMapReduce` provides unified groups at the end of the traversal computation.
  
  