void (PsiFile file) { Map<PsiJavaCodeReferenceElement, String> gold = new HashMap<>(); for (PsiJavaCodeReferenceElement ref : SyntaxTraverser.psiTraverser(file).filter(PsiJavaCodeReferenceElement.class)) { gold.put(ref, ref.advancedResolve(true).toString()); } for (PsiJavaCodeReferenceElement ref : gold.keySet()) { getPsiManager().dropPsiCaches(); assertEquals("Wrong resolve result for " + ref.getText(), gold.get(ref), ref.advancedResolve(true).toString()); } }