* @param sources The list of files to compile
* @param args Extra command-line arguments to pass to the compiler
*/
public void assertCompileSucceeds(List<JavaFileObject> sources, List<String> args) {
List<String> allArgs = buildArguments(args);
Result exitCode = compile(asJavacList(sources), allArgs.toArray(new String[0]));
List<Diagnostic<? extends JavaFileObject>> diagnostics = diagnosticHelper.getDiagnostics();
assertThat("Compilation failed: " + diagnostics.toString(), exitCode, is(Result.OK));
assertThat("Compilation succeeded but gave warnings: " + diagnostics.toString(),
diagnostics.size(), is(0));
}