--- old/test/lib/jdk/test/lib/process/OutputAnalyzer.java 2018-09-05 15:16:11.000000000 -0700 +++ new/test/lib/jdk/test/lib/process/OutputAnalyzer.java 2018-09-05 15:16:11.000000000 -0700 @@ -72,11 +72,12 @@ * @throws RuntimeException * If stdout was not empty */ - public void stdoutShouldBeEmpty() { + public OutputAnalyzer stdoutShouldBeEmpty() { if (!getStdout().isEmpty()) { reportDiagnosticSummary(); throw new RuntimeException("stdout was not empty"); } + return this; } /** @@ -85,11 +86,12 @@ * @throws RuntimeException * If stderr was not empty */ - public void stderrShouldBeEmpty() { + public OutputAnalyzer stderrShouldBeEmpty() { if (!getStderr().isEmpty()) { reportDiagnosticSummary(); throw new RuntimeException("stderr was not empty"); } + return this; } /** @@ -99,11 +101,12 @@ * @throws RuntimeException * If stderr was not empty */ - public void stderrShouldBeEmptyIgnoreVMWarnings() { + public OutputAnalyzer stderrShouldBeEmptyIgnoreVMWarnings() { if (!getStderr().replaceAll(jvmwarningmsg + "\\R", "").isEmpty()) { reportDiagnosticSummary(); throw new RuntimeException("stderr was not empty"); } + return this; } /** @@ -112,11 +115,12 @@ * @throws RuntimeException * If stdout was empty */ - public void stdoutShouldNotBeEmpty() { + public OutputAnalyzer stdoutShouldNotBeEmpty() { if (getStdout().isEmpty()) { reportDiagnosticSummary(); throw new RuntimeException("stdout was empty"); } + return this; } /** @@ -125,11 +129,12 @@ * @throws RuntimeException * If stderr was empty */ - public void stderrShouldNotBeEmpty() { + public OutputAnalyzer stderrShouldNotBeEmpty() { if (getStderr().isEmpty()) { reportDiagnosticSummary(); throw new RuntimeException("stderr was empty"); } + return this; } /** @@ -655,7 +660,7 @@ } List subList = lines.subList(fromIndex, toIndex); - Asserts.assertFalse(subList.isEmpty(), "There is no lines to check"); + Asserts.assertFalse(subList.isEmpty(), "There are no lines to check"); subList.stream() .filter(Pattern.compile(pattern).asPredicate().negate())