/**
  * Assert that the compile succeeds, and that for each line of the test file that contains the
  * pattern //BUG("foo"), the diagnostic at that line contains "foo".
  */
 public void assertCompileSucceedsWithMessages(File source) throws IOException {
   assertCompileSucceeds(source);
   assertHasDiagnosticOnAllMatchingLines(diagnosticHelper.getDiagnostics(), source);
 }
 /**
  * Assert that the compile fails, and that for each line of the test file that contains the
  * pattern //BUG("foo"), the diagnostic at that line contains "foo".
  */
 public void assertCompileFailsWithMessages(File source) throws IOException {
   assertThat("Compile should fail (exit with code 1)", compileFileExitCode(source), is(1));
   assertHasDiagnosticOnAllMatchingLines(diagnosticHelper.getDiagnostics(), source);
 }