code: private void visitInPreOrder(StateVisitor v, int node, BitSet visited) {
      if (visited.get(node)) {
        return;
      }
      visited.set(node);
  
      if (v.accept(node)) {
        for (int arc = getFirstArc(node); arc != 0; arc = getNextArc(arc)) {
          if (!isArcTerminal(arc)) {
            visitInPreOrder(v, getEndNode(arc), visited);
          }
        }
      }
    }
docs: Private recursion.