void () { DependenciesBuilder builder = new ForwardDependenciesBuilder(getProject(), new AnalysisScope(getProject())); builder.analyze(); Set<PsiFile> searchIn = new HashSet<>(); PsiClass aClass = myFixture.findClass("A"); searchIn.add(aClass.getContainingFile()); Set<PsiFile> searchFor = new HashSet<>(); PsiClass bClass = myFixture.findClass("B"); searchFor.add(bClass.getContainingFile()); UsageInfo[] usagesInfos = FindDependencyUtil.findDependencies(builder, searchIn, searchFor); UsageInfo2UsageAdapter[] usages = UsageInfo2UsageAdapter.convert(usagesInfos); String[] psiUsages = new String[usagesInfos.length]; for (int i = 0; i < usagesInfos.length; i++) { psiUsages[i] = toString(usages[i]); } checkResult(new String[]{ "2 B myB = new B();", "2 B myB = new B();", "4 myB.bb();"}, psiUsages); }