@Test
  public void testFailWithLineMissingFromEndOfOutput() throws Exception {
    final String goldenString = "Begin " + name() + ".main" + "\n" + "Press Enter to continue."
        + "\n" + problem() + "\n" + "End " + name() + ".main" + "\n";
    debug(goldenString, "GOLDEN");

    final ProcessWrapper process = createProcessWrapper(new ProcessWrapper.Builder(), getClass());
    process.execute(createProperties());
    process.waitForOutputToMatch("Begin " + name() + "\\.main");
    process.waitForOutputToMatch("Press Enter to continue\\.");
    process.sendInput();
    process.waitFor();

    try {
      assertOutputMatchesGoldenFile(process.getOutput(), goldenString);
      fail("assertOutputMatchesGoldenFile should have failed due to " + problem());
    } catch (AssertionError expected) {
      assertTrue("AssertionError message should contain \"" + problem() + "\"",
          expected.getMessage().contains(problem()));
    }
  }
Verifies that test output missing an expected line (at the middle of the golden file) will fail
with that line as the failure message.
geode-core/src/integrationTest/java/org/apache/geode/test/golden/FailWithLineMissingFromMiddleOfOutputJUnitTest.java