void (PsiElement element, String[] fileNames, int[] starts, int[] ends) { final ArrayList<PsiFile> filesList = new ArrayList<>(); final IntList startsList = new IntArrayList(); final IntList endsList = new IntArrayList(); ReferencesSearch.search(element, GlobalSearchScope.projectScope(element.getProject()), false).forEach(new PsiReferenceProcessorAdapter( ref -> { addReference(ref, filesList, startsList, endsList); return true; })); checkResult(fileNames, filesList, starts, startsList, ends, endsList); }