@Test
public void multilineCompileError() throws Exception {

  createTempFile(DOT_JAVA);
  String output =
    ":two:compileDebug\n" +
    sourceFilePath + ":20: incompatible types\n" +
    "found   : java.util.ArrayList<java.lang.String>\n" +
    "required: java.util.Set<java.lang.String>\n" +
    "        Set<String> checkedList = new ArrayList<String>();\n" +
    "                                  ^\n" +
    "1 error\n" +
    ":two:compileDebug FAILED\n" +
    "\n" +
    "FAILURE: Build failed with an exception.\n" +
    "\n" +
    "* What went wrong:\n" +
    "Execution failed for task ':two:compileDebug'.\n" +
    "> Compilation failed; see the compiler error output for details.\n" +
    "\n" +
    "* Try:\n" +
    "Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.\n" +
    "\n" +
    "BUILD FAILED\n" +
    "\n" +
    "Total time: 5.354 secs\n";
  assertEquals("0: Simple::two:compileDebug\n" +
               "1: Error:incompatible types\n" +
               "found   : java.util.ArrayList<java.lang.String>\n" +
               "required: java.util.Set<java.lang.String>\n" +
               "\t" + sourceFilePath + ":20:35\n" +
               "2: Simple::two:compileDebug FAILED\n" +
               "3: Error:Execution failed for task ':two:compileDebug'.\n" +
               "> Compilation failed; see the compiler error output for details.\n" +
               "4: Info:BUILD FAILED\n" +
               "5: Info:Total time: 5.354 secs\n",
               toString(parser.parseGradleOutput(output)).replaceAll("\r\n","\n"));
  sourceFile.delete();
}