OcelotProcessor extends AbstractProcessor { void initVisitors(String fwk) { visitorNofwk = new DataServiceVisitorJsBuilder(processingEnv, new NoFwk()); visitorNgfwk = new DataServiceVisitorJsBuilder(processingEnv, new AngularFwk()); visitorfwk = visitorNofwk; if ("ng".equals(fwk)) { visitorfwk = visitorNgfwk; } }  @Override void init(ProcessingEnvironment processingEnv); @Override boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv); void processElement(Element element);  }
@Test public void initVisitorsTest() { System.out.println("initVisitors"); doCallRealMethod().when(instance).initVisitors(null); instance.initVisitors(null); assertThat(instance.visitorfwk).isEqualTo(instance.visitorNofwk); instance.initVisitors("bad"); assertThat(instance.visitorfwk).isEqualTo(instance.visitorNofwk); instance.initVisitors("ng"); assertThat(instance.visitorfwk).isEqualTo(instance.visitorNgfwk); }