@Override
  public CommonProblemDescriptor @Nullable [] checkPackage(@NotNull RefPackage refPackage,
                                                           @NotNull AnalysisScope analysisScope,
                                                           @NotNull InspectionManager inspectionManager,
                                                           @NotNull GlobalInspectionContext globalInspectionContext) {
    final Project project = inspectionManager.getProject();
    final PsiPackage aPackage = ReadAction.compute(() -> JavaPsiFacade.getInstance(project).findPackage(refPackage.getQualifiedName()));
    if (aPackage == null)  return null;
    final PsiFile @NotNull [] files = ReadAction.compute(() -> aPackage.getFiles(GlobalSearchScope.projectScope(project)));
    final Set<@NotNull Module> modules = new HashSet<>();
    final ProjectFileIndex index = ProjectFileIndex.getInstance(project);
    for (PsiFile file : files) {
      final Module module = index.getModuleForFile(file.getVirtualFile());
      if (module != null) {
        modules.add(module);
      }
    }
    final int moduleCount = modules.size();
    if (moduleCount <= 1) {
      return null;
    }
    final List<Module> moduleList = new ArrayList<>(modules);
    final String errorString;
    if (moduleCount == 2) {
      errorString = InspectionGadgetsBundle.message(
        "package.in.multiple.modules.problem.descriptor2", refPackage.getQualifiedName(),
        moduleList.get(0).getName(), moduleList.get(1).getName());
    }
    else if (moduleCount == 3) {
      errorString = InspectionGadgetsBundle.message(
        "package.in.multiple.modules.problem.descriptor3", aPackage.getQualifiedName(),
        moduleList.get(0).getName(), moduleList.get(1).getName(), moduleList.get(2).getName());
    }
    else {
      errorString = InspectionGadgetsBundle.message(
        "package.in.multiple.modules.problem.descriptor.many", aPackage.getQualifiedName(),
        moduleList.get(0).getName(), moduleList.get(1).getName(), moduleCount - 2);
    }

    return new CommonProblemDescriptor[]{
      inspectionManager.createProblemDescriptor(errorString)
    };
  }
@Override
  public CommonProblemDescriptor @Nullable [] checkPackage(@NotNull RefPackage refPackage,
                                                           @NotNull AnalysisScope analysisScope,
                                                           @NotNull InspectionManager inspectionManager,
                                                           @NotNull GlobalInspectionContext globalInspectionContext)