void (String qNameToSearch, final PsiElement originalElement, String[] fileNames, int[] starts, int[] ends) { PsiSearchHelper helper = PsiSearchHelper.getInstance(myProject); final List<PsiFile> filesList = new ArrayList<>(); final IntList startsList = new IntArrayList(); final IntList endsList = new IntArrayList(); helper.processUsagesInNonJavaFiles(originalElement, qNameToSearch, (file, startOffset, endOffset) -> { filesList.add(file); startsList.add(startOffset); endsList.add(endOffset); return true; }, GlobalSearchScope.projectScope(myProject) ); assertEquals("usages count", fileNames.length, filesList.size()); for (int i = 0; i < fileNames.length; i++) { assertEquals("files[" + i + "]", fileNames[i], filesList.get(i).getName()); } for (int i = 0; i < starts.length; i++) { assertEquals("starts[" + i + "]", starts[i], startsList.getInt(i)); } for (int i = 0; i < ends.length; i++) { assertEquals("ends[" + i + "]", ends[i], endsList.getInt(i)); } }