Set<String> (final @NotNull String packageName, @NotNull GlobalSearchScope scope) { final PackageInfo info = getPackageInfo(packageName); if (info == null) return Collections.emptySet(); final Set<String> result = new HashSet<>(); for (Map.Entry<String, Collection<VirtualFile>> entry : info.mySubPackages.getValue().entrySet()) { final String shortName = entry.getKey(); final Collection<VirtualFile> directories = entry.getValue(); if (ContainerUtil.exists(directories, scope::contains)) { result.add(shortName); } } return Collections.unmodifiableSet(result); }