import edu.neu.ccs.demeter.dj.*; import java.util.*; class Main { public static void main(String[] args) { ClassGraph cg = new ClassGraph(true,false); // constructed by reflection System.out.println("Class graph"); System.out.println(cg); System.out.println("End of Class graph"); A a = new A ( new B( new D( new E( new F(7) ), new X( new F(9)) ) ), new C()); // cg.traverse(a, new StrategyGraph("A->F"), new MyVisitor()); Strategy sg = new Strategy("from A through X to F"); TraversalGraph tg = new TraversalGraph(sg, cg); tg.traverse(a, new MyVisitor()); List result = tg.gather(a); System.out.println(" found " + result.size()); System.out.println("Traversal Graph for from A to F"); System.out.println(tg); } }