import EDU.neu.ccs.demeter.dj.*; interface Predicate { boolean match(Object obj); } class Main { public static void main(String[] args) { ClassGraph cg = new ClassGraph(); // constructed from *.java A a = new A(new B(new D()), new C()); // cg.traverse(a, new StrategyGraph("A->D"), new MyVisitor()); Strategy sg = new Strategy("from A to D"); TraversalGraph tg = TraversalGraph.compute(cg, sg); tg.traverse(a, new MyVisitor()); System.out.println("Traversal Graph for from A to D"); System.out.println(tg); MyClassGraph cg2 = new MyClassGraph(); D d = (D) cg2.fetch2(a, new Strategy("to D"), new Predicate () { public boolean match(Object obj) { return true; // ((D) obj).get_isbn() == 6789907889; } }); } }