void (GlobalSearchScope searchScope, String... expectedPaths) { Collection<VirtualFile> roots; if (searchScope instanceof DelegatingGlobalSearchScope) { searchScope = ReflectionUtil.getField(DelegatingGlobalSearchScope.class, searchScope, GlobalSearchScope.class, "myBaseScope"); } if (searchScope instanceof ModuleWithDependenciesScope) { roots = ((ModuleWithDependenciesScope)searchScope).getRoots(); } else { roots = ((LibraryRuntimeClasspathScope)searchScope).getRoots(); } final List<VirtualFile> entries = new ArrayList<>(roots); entries.removeAll(Arrays.asList(ProjectRootManager.getInstance(myProject).orderEntries().sdkOnly().classes().getRoots())); List<String> actualPaths = new ArrayList<>(); for (VirtualFile each : entries) { actualPaths.add(each.getPresentableUrl()); } assertPaths(expectedPaths, actualPaths); }