void (@NotNull MarkupModelEx markupModel, @NotNull List<? super String> events) { markupModel.addMarkupModelListener(getTestRootDisposable(), new MarkupModelListener() { @Override public void afterAdded(@NotNull RangeHighlighterEx highlighter) { events.add(highlighter.getTextRange() + ": AA"); } @Override public void beforeRemoved(@NotNull RangeHighlighterEx highlighter) { events.add(highlighter.getTextRange() + ": BR"); } @Override public void afterRemoved(@NotNull RangeHighlighterEx highlighter) { events.add(highlighter.getTextRange() + ": AR"); } @Override public void attributesChanged(@NotNull RangeHighlighterEx highlighter, boolean renderersChanged, boolean fontStyleOrColorChanged) { events.add(highlighter.getTextRange() + ": AC"); } }); }