public void run() throws Exception { File javaFile = writeTestFile(); File classFile = compileTestFile(javaFile); ClassFile cf = ClassFile.read(classFile); test(cf); for (Field f : cf.fields) { test(cf, f); } for (Method m : cf.methods) { test(cf, m); } countAnnotations(); if (errors > 0) throw new Exception(errors + " errors found"); System.out.println("PASSED"); }