try {
Enhancer enhancer = new Enhancer();
enhancer.setInterfaces(new Class[] {forClass});
enhancer.setCallbackFilter(FILTER);
enhancer.setCallbackTypes(new Class[] {NoOp.class, MethodInterceptor.class});
Class<?> newClass = enhancer.createClass();
Enhancer.registerStaticCallbacks(newClass, new Callback[] {NoOp.INSTANCE,
new InterfaceMethodInterceptor(reference, forClass)});
result = newClass.newInstance();
} catch (Exception e) {
e.printStackTrace();