title: How to traverse verticies using gremlin java and orientdb
body: <p>I'm new in Graph databases, and i can't resolve problem listed below.
  How i can implement OrientDb query like 
  <code>TRAVERSE OUT() FROM (SELECT FROM SomeClassThatExtendsV WHERE name = 'SomeUsefulName')</code></p>
  
  <p>If i will execute this query via OrientDb java api :</p>
  
  <p><code>new OSQLSynchQuery&lt;Vertex&gt;("TRAVERSE OUT() FROM (SELECT FROM SomeClassThatExtendsV WHERE name = 'SomeUsefulName')");</code></p>
  
  <p>The result will be all child verticies with child and child and so on.</p>
  
  <p>I need to implement same logic using gremlin api, that's what i have:</p>
  
  <pre><code>    GraphQuery query = framedGraph.getBaseGraph().query().has("@class", "SomeClassThatExtendsV").has("name", "SomeUsefulName");
      OrientVertex vertex = (OrientVertex) query.vertices().iterator().next();
      Tree tree = new Tree();
      new GremlinPipeline(vertex).out().tree(tree).loop("TestLoop", loopBundle -&gt; false).iterate();
      Iterator it = tree.entrySet().iterator();
      while (it.hasNext()) {
          Map.Entry pair = (Map.Entry)it.next();
          System.out.println(pair.getKey() + " = " + pair.getValue());
  
      }
  </code></pre>
  
  <p>As result i have NullPointerException.</p>
  
  <pre><code>java.lang.NullPointerException
      at com.tinkerpop.pipes.branch.LoopPipe.getLoops(LoopPipe.java:75)
      at com.tinkerpop.pipes.branch.LoopPipe.processNextStart(LoopPipe.java:49)
      at com.tinkerpop.pipes.AbstractPipe.next(AbstractPipe.java:89)
      at com.tinkerpop.pipes.util.Pipeline.next(Pipeline.java:115)
      at com.tinkerpop.pipes.util.PipeHelper.iterate(PipeHelper.java:35)
      at com.tinkerpop.gremlin.java.GremlinPipeline.iterate(GremlinPipeline.java:1542) 
  </code></pre>
  
  <p>Maybe i'm doing something wrong in when in GremlinPipeline? </p>
  
  <p>At this point i don't know full graph structure and i need to get something like tree, or something like result in OrientDb studio.</p>
  
  <p>Some update here, i tried to use loop but as i told before i can't setup count of loops and due to this my test application stuck because in some vertices i have in edge and out edge.</p>
  
  <p>Could somebody help me with this problem?</p>