void () { withCycleConsoleNoFolding(1000, consoleView -> { String text = "long text"; consoleView.print(text, ConsoleViewContentType.SYSTEM_OUTPUT); consoleView.waitAllRequests(); //editor contains `text` assertEquals(text.length(), consoleView.getEditor().getDocument().getTextLength()); consoleView.clear(); consoleView.print(text, ConsoleViewContentType.SYSTEM_OUTPUT); //assert console's editor text which is about to be cleared is not added assertEquals(text.length(), consoleView.getContentSize()); }); }