void () { PsiClass aClass = myFixture.addClass(""" class A { void foo(){} void bar() { foo(); } } """); PsiMethod[] foos = aClass.findMethodsByName("foo", false); assertEquals(1, foos.length); PsiMethod foo = foos[0]; PsiReference ref = ReferencesSearch.search(foo).findFirst(); assertNotNull(ref); assertEquals(""" <root> (1) Usages in (1) A (1) bar() (1) 3{ foo(); """, myFixture.getUsageViewTreeTextRepresentation(Collections.singleton(new UsageInfo(ref)))); } }