@Test
public void constructorAppender() throws Exception {
ClassReader cr = new ClassReader(loadBytesForClass("plugins.One"));
Target.reset();
ClassVisitingConstructorAppender ca = new ClassVisitingConstructorAppender(Target.class.getName().replace('.', '/'), "foo");
cr.accept(ca, 0);
byte[] newbytes = ca.getBytes();
Class<?> clazz = loadit("plugins.One", newbytes);
clazz.newInstance();
List<Object> instances = Target.collectedInstances;
assertEquals(1, instances.size());
assertTrue(instances.get(0).toString().startsWith("plugins.One"));