@Benchmark
    public Class<?> benchmarkJavassist() {
        ProxyFactory proxyFactory = new ProxyFactory() {
            protected ClassLoader getClassLoader() {
                return newClassLoader();
            }
        };
        proxyFactory.setUseCache(false);
        proxyFactory.setUseWriteReplace(false);
        proxyFactory.setSuperclass(baseClass);
        proxyFactory.setFilter(new MethodFilter() {
            public boolean isHandled(Method method) {
                return false;
            }
        });
        return proxyFactory.createClass();
    }
@ Benchmark public Class < ? > benchmarkJavassist ( ) { ProxyFactory proxyFactory = new ProxyFactory ( ) { protected ClassLoader getClassLoader ( ) { return newClassLoader ( ) ; } } ; proxyFactory . setUseCache ( false ) ; proxyFactory . setUseWriteReplace ( false ) ; proxyFactory . setSuperclass ( baseClass ) ; proxyFactory . setFilter ( new MethodFilter ( ) { public boolean isHandled ( Method method ) { return false ; } } ) ; return proxyFactory . createClass ( ) ; }
Performs a benchmark for a trivial class creation using javassist proxies.

@return The created instance, in order to avoid JIT removal.