public void traverse(int distance,Collection<Dependency> start,TraversePredicate predicate){
  if (distance <= 0) {
    return;
  }
  final ImmutableStack<WordToken> history=new ImmutableStack<WordToken>();
  for (  final Dependency d : start) {
    if (predicate.test(d,null,d.getDependent(),history)) {
      ImmutableStack<WordToken> stack=history.push(d.getDependent());
      traverse(distance,d.getDependent(),stack,predicate);
    }
  }
}

public void traverse ( int distance , Collection < Dependency > start , TraversePredicate predicate ) { if ( distance <= 0 ) { return ; } final ImmutableStack < WordToken > history = new ImmutableStack < WordToken > ( ) ; for ( final Dependency d : start ) { if ( predicate . test ( d , null , d . getDependent ( ) , history ) ) { ImmutableStack < WordToken > stack = history . push ( d . getDependent ( ) ) ; traverse ( distance , d . getDependent ( ) , stack , predicate ) ; } } }
traverse the graph looking
