void (@NonNls String[] expectedFiles) { List<String> names = new ArrayList<>(); PsiTodoSearchHelper.getInstance(myProject).processFilesWithTodoItems(o -> { names.add(o.getName()); return true; }); assertEquals(expectedFiles.length, names.size()); Collections.sort(names); Arrays.sort(expectedFiles); assertEquals(Arrays.asList(expectedFiles), names); }