Collection<PsiPackage> (@Nullable final PsiPackage context, final String packageName) { if (context == null) return Collections.emptySet(); if (packageName.contains("*")) { final Set<PsiPackage> packages = new LinkedHashSet<>(); final Pattern pattern = PatternUtil.fromMask(packageName); processSubPackages(context, psiPackage -> { String name = psiPackage.getName(); if (name != null && pattern.matcher(name).matches()) { packages.add(psiPackage); } return true; }); return packages; } return super.resolvePackageName(context, packageName); }