ClassWriter cw = new ClassWriter(0);
CheckClassAdapter ca = new CheckClassAdapter(cw);
AddFieldAdapter af = new AddFieldAdapter(ca, ACC_PUBLIC, "field",
"I");
generateBasicClass(af);
checkClass(defineClass("C", cw.toByteArray()));
}
protected void checkClass(Class c) throws Exception {
Field f = c.getField("field");
assertEquals(f.getType(), int.class);