PipedApplicationConsole extends AbstractPipedApplicationConsole { public BufferedReader getErrorReader() { return stderrReader; } PipedApplicationConsole();  PipedApplicationConsole(int pipeSize);  PipedApplicationConsole(int     pipeSize,
                                   boolean diagnosticMode); BufferedReader getOutputReader(); BufferedReader getErrorReader(); PrintWriter getInputWriter();  }
@Test public void shouldBeAbleToReadPipedStdErrAfterConsoleClosed() throws Exception { PipedApplicationConsole console = new PipedApplicationConsole(1024, false); try (JavaApplication application = LocalPlatform.get().launch(JavaApplication.class, ClassName.of(SimpleApp.class), Arguments.of("foo", "bar"), Console.of(console))) { application.waitFor(); } BufferedReader reader = console.getErrorReader(); String line = reader.readLine(); while(line.contains("JAVA_TOOL_OPTIONS")) { line = reader.readLine(); } assertThat(line, is("Err: foo")); assertThat(reader.readLine(), is("Err: bar")); assertThat(reader.readLine(), is("(terminated)")); assertThat(reader.readLine(), is(nullValue())); }