void () { Process testProcess = AnsiEscapeDecoderTest.createTestProcess(); ByteArrayOutputStream outputStream = (ByteArrayOutputStream)testProcess.getOutputStream(); AnsiEscapeDecoderTest.withProcessHandlerFrom(testProcess, handler -> withCycleConsoleNoFolding(100, console -> { console.attachToProcess(handler); outputStream.reset(); Editor editor = console.getEditor(); typeIn(editor, 'X'); console.waitAllRequests(); assertEquals(0, outputStream.size()); typeIn(editor, 'Y'); console.waitAllRequests(); assertEquals(0, outputStream.size()); typeIn(editor, '\n'); console.waitAllRequests(); assertEquals(3, outputStream.size()); assertEquals("XY\n", outputStream.toString()); })); }