rfValidator.setForceErrors(true);
rfValidator.setClientOnly(clientOnly);
DiagnosticCollector<JavaFileObject> expectedCollector =
new DiagnosticCollector<JavaFileObject>();
CompilationTask expectedTask =
compiler.getTask(errorWriter, fileManager, expectedCollector, Arrays.asList("-proc:only"),
null, files);
expectedTask.setProcessors(Arrays.asList(new ExpectCollector()));
expectedTask.call();
DiagnosticCollector<JavaFileObject> actualCollector = new DiagnosticCollector<JavaFileObject>();
CompilationTask actualTask =
compiler.getTask(errorWriter, fileManager, actualCollector, Arrays.asList("-proc:only"),
null, files);
actualTask.setProcessors(Arrays.asList(rfValidator));
actualTask.call();
TreeSet<Diagnostic<? extends JavaFileObject>> expected =
new TreeSet<Diagnostic<? extends JavaFileObject>>(new DiagnosticComparator());
expected.addAll(expectedCollector.getDiagnostics());
TreeSet<Diagnostic<? extends JavaFileObject>> actual =