@Benchmark
    public Class<?> benchmarkCglib() {
        Enhancer enhancer = new Enhancer();
        enhancer.setUseCache(false);
        enhancer.setClassLoader(newClassLoader());
        enhancer.setSuperclass(baseClass);
        enhancer.setCallbackType(NoOp.class);
        return enhancer.createClass();
    }
@ Benchmark public Class < ? > benchmarkCglib ( ) { Enhancer enhancer = new Enhancer ( ) ; enhancer . setUseCache ( false ) ; enhancer . setClassLoader ( newClassLoader ( ) ) ; enhancer . setSuperclass ( baseClass ) ; enhancer . setCallbackType ( NoOp . class ) ; return enhancer . createClass ( ) ; }
Performs a benchmark for a trivial class creation using cglib.

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