class EventStubGenerator {

    public GeneratedClass getFrontend() {
        JavaVar target = JavaVar.of(senderInterface, "target");

        ClassBuilder cb = new ClassBuilder(myFrontendName(), stubsPackage);
        addGeneratedAnnotation(cb);
        cb.implement(listenerInterface);
        cb.fieldsAndConstructorParameters(Arrays.asList(target));

        for (JavaMethod method : listenerMethods) {
            cb.addMethod("" +
                    "    @Override\n" +
                    "    public void " + method.getName() + "(" + JavaVar.toFormalArguments(method.getArguments(), cb.imports) + ") {\n" +
                    "        " + target.getName() + ".send(new " + myEventWrapperName(method) + "(" + JavaVar.toActualArguments(method.getArguments()) + "));\n" +
                    "    }\n");
        }
        return cb.build();
    }

    public  EventStubGenerator(TypeElement listenerType, String targetPackage);

}