void () { HyperlinkInfo customHyperlink = project -> { }; Filter customFilter = (line, entireLength) -> { try { TimeUnit.MILLISECONDS.sleep(100); } catch (InterruptedException ignored) { } return new Filter.Result(0, 10, customHyperlink); }; myConsole.addMessageFilter(customFilter); myConsole.print("the only line", ConsoleViewContentType.NORMAL_OUTPUT); myConsole.waitAllRequests(); for (int i = 0; i < 10; ++i) { myConsole.rehighlightHyperlinksAndFoldings(); } myConsole.waitAllRequests(); myConsole.getHyperlinks().waitForPendingFilters(2000); assertEquals(1, myConsole.getHyperlinks().findAllHyperlinksOnLine(0).size()); }