void (VirtualFile file, Class refClass) { PsiReference ref = getReferenceAtCaret(file); if (ref == null) return; PsiReference[] refs = ref instanceof PsiMultiReference ? ((PsiMultiReference)ref).getReferences() : new PsiReference[]{ref}; for (PsiReference each: refs) { assertFalse(each.toString(), refClass.isInstance(each)); } }