void () { configureByText(JavaFileType.INSTANCE, """ class S { int f() { return <caret>hashCode(); }}"""); Collection<HighlightInfo> infos = doHighlighting(HighlightInfoType.SYMBOL_TYPE_SEVERITY); assertEquals(3, infos.size()); AtomicInteger count = new AtomicInteger(); MarkupModelEx modelEx = (MarkupModelEx)DocumentMarkupModel.forDocument(getDocument(getFile()), getProject(), true); modelEx.addMarkupModelListener(getTestRootDisposable(), new MarkupModelListener() { @Override public void afterAdded(@NotNull RangeHighlighterEx highlighter) { count.incrementAndGet(); } @Override public void afterRemoved(@NotNull RangeHighlighterEx highlighter) { count.incrementAndGet(); } }); type(' '); assertEmpty(highlightErrors()); assertEquals(0, count.get()); }