ClassWriter cw1 = new ClassWriter(0);
ClassWriter cw2 = new ClassWriter(0);
cr.accept(new ReferenceClassAdapter(cw1), ClassReader.EXPAND_FRAMES);
cr.accept(new AdviceClassAdapter(cw2), ClassReader.EXPAND_FRAMES);
assertEquals(new ClassReader(cw1.toByteArray()),
new ClassReader(cw2.toByteArray()));
}
static class ReferenceClassAdapter extends ClassAdapter {
public ReferenceClassAdapter(final ClassVisitor cv) {