ClassAgent aca = getNewClassAgent();
aca.addInterceptor(MethodMatcherFactory.matcher("run"), new MethodCounter(crun));
aca.addInterceptor(MethodMatcherFactory.matcher(".*"), new MethodCounter(cc));
aca.addInterceptor(MethodMatcherFactory.matcher("doSomething"), new RhinocerosListener());
Class<? extends Rhinoceros> c = aca.define(Nutzs.cd(), Rhinoceros.class);// RA.class;
Rhinoceros r = Mirror.me(c).born();
r.doSomething(BEH.run);
r.doSomething(BEH.fight);
try {
r.doSomething(BEH.lecture);
fail();
}
catch (Throwable e) {}
try {
r.doSomething(BEH.fly);
fail();
}
catch (Throwable e) {}
// assertEquals("[5, 3, 1, 1]", Json.toJson(cc));
assertEquals("[1, 1, 0, 0]", Json.toJson(crun));