{
ClassFab cf = newClassFab("Fail", Object.class);
cf.addInterface(FailService.class);
MethodFab mf =
cf.addMethod(
Modifier.PUBLIC,
new MethodSignature(void.class, "fail", null, null),
"throw new java.lang.RuntimeException(\"Ouch!\");");
mf.addCatch(RuntimeException.class, "throw new java.io.IOException($e.getMessage());");
Class targetClass = cf.createClass();
FailService fs = (FailService) targetClass.newInstance();