boolean (@Nullable String className, @NotNull PsiJavaFile file) { if (className == null) return false; for (String packageName : file.getImplicitlyImportedPackages()) { if (hasPackage(className, packageName)) return true; } return false; }