class JavaAssistCompiler extends JavaCompilerImpl {

    @Override
    public Class<?> compile(ClassData classData) throws Exception {
        String packageName = classData.getPackageName();
        String className = classData.getClassName();
        String methodText = ((JavaAssistClassData)classData).getMethodText();
        String bridgeMethodText = ((JavaAssistClassData)classData).getBridgeMethodText();

        ClassPool classPool = new ClassPool(true);

        CtClass superClass = resolveClass(DefaultFEELLib.class);
        CtClass superInterface = resolveClass(LambdaExpression.class);

        CtClass lambdaImplClass = classPool.makeClass(packageName + "." + className);
        lambdaImplClass.setSuperclass(superClass);
        lambdaImplClass.addInterface(superInterface);

        CtMethod applyMethod = CtNewMethod.make(methodText, lambdaImplClass);
        applyMethod.setModifiers(applyMethod.getModifiers() | Modifier.VARARGS);
        lambdaImplClass.addMethod(applyMethod);

        CtMethod applyBridgeMethod = CtMethod.make(bridgeMethodText, lambdaImplClass);
        lambdaImplClass.addMethod(applyBridgeMethod);

        return lambdaImplClass.toClass();
    }

}