title: Gremlin 3 stop repeat at specified depth (java)
body: <p>I want a query that traverses downwards on a certain edge type until it hits a vertex with a given property OR it reaches a given distance from the starting vertex.</p>
  
  <p>I can get this traversal to stop when it hits a certain vertex type, but I can't make it stop at a given depth / distance. There must be something wrong with the way I'm using the "simplePath" and "count" steps, but I'm not sure what it is.</p>
  
  <p>Here's the Java code:</p>
  
  <pre><code>GraphTraversal&lt;Vertex, TinkerGraph&gt; traversal = g.V(start)
      .repeat(__.outE("type").subgraph("subGraph").inV())
      .until(
              __.or(
                  //this line works just fine
                  __.has("type", "one"),   
                  //this line doesn't seem to do what I expect,
                  //stop when the size of the path from "start" gets too long
                  __.simplePath().count().is(P.gt(3))
              )
      )
      .cap("subGraph");
  </code></pre>
  
  <p>So what do I need to do to make this traversal stop when the size of the path from the "start" vertex to the current vertex is greater than 3?</p>