static HighlightInfo.Builder checkPackageStatement(@NotNull PsiPackageStatement statement, @NotNull PsiFile file, @Nullable PsiJavaModule javaModule) {
    if (PsiUtil.isModuleFile(file)) {
      String message = JavaErrorBundle.message("module.no.package");
      HighlightInfo.Builder info = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(statement).descriptionAndTooltip(message);
      IntentionAction action = QuickFixFactory.getInstance().createDeleteFix(statement);
      info.registerFix(action, null, null, null, null);
      return info;
    }

    if (javaModule != null) {
      String packageName = statement.getPackageName();
      if (packageName != null) {
        PsiJavaModule origin = JavaModuleGraphUtil.findOrigin(javaModule, packageName);
        if (origin != null) {
          String message = JavaErrorBundle.message("module.conflicting.packages", packageName, origin.getName());
          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(statement).descriptionAndTooltip(message);
        }
      }
    }
    else {
      Module module = ModuleUtilCore.findModuleForFile(file);
      if (module == null) {
        return null;
      }
      PsiJavaCodeReferenceElement reference = statement.getPackageReference();
      PsiPackage pack = (PsiPackage)reference.resolve();
      if (pack != null) {
        ProjectFileIndex fileIndex = ProjectRootManager.getInstance(pack.getProject()).getFileIndex();
        for (PsiDirectory directory : pack.getDirectories()) {
          PsiJavaModule anotherJavaModule = JavaModuleGraphUtil.findDescriptorByElement(directory);
          if (anotherJavaModule != null) {
            VirtualFile moduleVFile = PsiUtilCore.getVirtualFile(anotherJavaModule);
            if (moduleVFile != null && ContainerUtil.find(fileIndex.getOrderEntriesForFile(moduleVFile), JdkOrderEntry.class::isInstance) != null) {
              VirtualFile rootForFile = fileIndex.getSourceRootForFile(file.getVirtualFile());
              if (rootForFile != null && JavaCompilerConfigurationProxy.isPatchedModuleRoot(anotherJavaModule.getName(), module, rootForFile)) {
                return null;
              }
              return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR)
                .range(reference)
                .descriptionAndTooltip(JavaErrorBundle.message("module.conflicting.packages", pack.getName(), anotherJavaModule.getName()));
            }
          }
        }
      }
    }

    return null;
  }
static HighlightInfo.Builder checkPackageStatement(@NotNull PsiPackageStatement statement, @NotNull PsiFile file, @Nullable PsiJavaModule javaModule)