Main { public static ClassGraph buildClassGraph() {{ ClassGraph cg=new ClassGraph(true,false); // true: include all fields // false: do NOT include all non-void no-argument methods System.out.println("The DJ version is: " + cg.getVersion()); System.out.println("The class graph is" + "============================="); System.out.println(cg); System.out.println("end class graph " + "============================="); return cg; }} } Cd_graph { Integer countInhRelsDJ (ObjectGraphSlice subClassSlice) {{ CountingVisitorDJ count = new CountingVisitorDJ(); Integer result = (Integer) subClassSlice.traverse(count); return result; }} } CountingVisitorDJ { {{ int c; }} public void start() {{ c=0; System.out.println("begin"); }} public void before(Vertex o) {{ c++; System.out.println("before Vertex"); }} public void after(Cd_graph o) {{ System.out.println("after Cd_graph"); }} public Object getReturnValue() {{return new Integer(c);}} }