private void traverseEdges(Region r, RegionDigraphVisitor visitor, Set<Region> path) {
   for (FilteredRegion fr : r.getEdges()) {
     if (visitor.preEdgeTraverse(fr.getFilter())) {
       try {
         visitRemainingSubgraph(fr.getRegion(), visitor, extendPath(r, path));
       } finally {
         visitor.postEdgeTraverse(fr.getFilter());
       }
     }
   }
 }
 private void visitRemainingSubgraph(Region r, RegionDigraphVisitor visitor, Set<Region> path) {
   if (!path.contains(r)) {
     if (visitor.visit(r)) {
       traverseEdges(r, visitor, path);
     }
   }
 }