EventStubGenerator { public GeneratedClass getBackend() { JavaVar target = JavaVar.of(listenerInterface, "target"); ClassBuilder cb = new ClassBuilder(myBackendName(), stubsPackage); addGeneratedAnnotation(cb); cb.implement(senderInterface); cb.fieldsAndConstructorParameters(Arrays.asList(target)); cb.addMethod("" + " @Override\n" + " public void send(" + cb.imports.getSimpleName(eventInterface) + " message) {\n" + " message.fireOn(" + target.getName() + ");\n" + " }\n"); return cb.build(); } EventStubGenerator(TypeElement listenerType, String targetPackage); void setGeneratorName(String generatorName); void setGenerationDate(Date generationDate); List<GeneratedClass> getGeneratedClasses(); GeneratedClass getEventizer(); GeneratedClass getFrontend(); GeneratedClass getBackend(); List<GeneratedClass> getEvents();  }
@Test public void generates_backend_class() { assertClassEquals("fi.jumi.actors.generator.reference.dummyListener.EventToDummyListener", generator.getBackend()); }