ErrorProneOptions errorProneOptions = ErrorProneOptions.processArgs(ArrayUtil.toStringArray(ContainerUtil.toCollection(options)));
List<String> remainingOptions = Arrays.asList(errorProneOptions.getRemainingArgs());
CompilationTask task = myJavacTool.getTask(out, fileManager, diagnosticListener, remainingOptions, classes, compilationUnits);
Context context = ((JavacTaskImpl)task).getContext();
try {
ErrorProneScanner scanner = new ErrorProneScanner(ErrorProneScanner.EnabledPredicate.DEFAULT_CHECKS);
Method setDisabledChecks = ErrorProneScanner.class.getDeclaredMethod("setDisabledChecks", Set.class);
setDisabledChecks.setAccessible(true);
setDisabledChecks.invoke(scanner, errorProneOptions.getDisabledChecks());
context.put(Scanner.class, scanner);
}