void () { Disposer.dispose(myConsole); // have to re-init extensions List<Pair<String, ConsoleViewContentType>> registered = new ArrayList<>(); ConsoleInputFilterProvider crazyProvider = project -> new InputFilter[]{ (text, contentType) -> { registered.add(Pair.create(text, contentType)); return Collections.singletonList(Pair.create("+!" + text + "-!", contentType)); } }; ConsoleInputFilterProvider.INPUT_FILTER_PROVIDERS.getPoint().registerExtension(crazyProvider, getTestRootDisposable()); myConsole = createConsole(); StringBuilder expectedText = new StringBuilder(); List<Pair<String, ConsoleViewContentType>> expectedRegisteredTokens = new ArrayList<>(); for (int i=0;i<25;i++) { String chunk = String.valueOf(i); myConsole.print(chunk, ConsoleViewContentType.USER_INPUT); expectedText.append("+!" + i + "-!"); expectedRegisteredTokens.add(Pair.create(chunk, ConsoleViewContentType.USER_INPUT)); for (int j = 0; j < chunk.length(); j++) { typeIn(myConsole.getEditor(), chunk.charAt(j)); } chunk.chars().forEach(c->{ expectedText.append("+!" + (char)c + "-!"); expectedRegisteredTokens.add(Pair.create(String.valueOf((char)c), ConsoleViewContentType.USER_INPUT)); }); } myConsole.flushDeferredText(); myConsole.waitAllRequests(); assertEquals(expectedText.toString(), myConsole.getText()); assertEquals(expectedRegisteredTokens, registered); }