void () { IdentifierHighlighterPassFactory.doWithHighlightingEnabled(getProject(), getTestRootDisposable(), ()->{ try { createClass(""" class Foo { static void foo(int a) {} static void foo(int a, int b) {} }"""); } catch (IOException e) { throw new RuntimeException(e); } configureByText(JavaFileType.INSTANCE, """ import static Foo.fo<caret>o; class Bar { { foo(1); } }"""); IdentifierHighlighterPassFactory.waitForIdentifierHighlighting(); assertEquals(2, getIdentifierHighlighters() .stream() .filter(info -> getFile().getText().substring(info.startOffset, info.endOffset).equals("foo")) .count()); }); }