@Override
  public CommonProblemDescriptor @Nullable [] checkPackage(@NotNull RefPackage refPackage,
                                                           @NotNull AnalysisScope analysisScope,
                                                           @NotNull InspectionManager inspectionManager,
                                                           @NotNull GlobalInspectionContext globalInspectionContext) {
    int numClasses = ReadAction.compute(() -> {
      final Project project = inspectionManager.getProject();
      final PsiPackage aPackage = JavaPsiFacade.getInstance(project).findPackage(refPackage.getQualifiedName());
      if (aPackage == null || aPackage.getSubPackages().length > 0) {
        return -1;
      }
      return aPackage.getClasses(GlobalSearchScope.projectScope(project)).length;
    });
    if (numClasses < 0 || numClasses >= limit) {
      return null;
    }
    final String errorString = InspectionGadgetsBundle.message("package.with.too.few.classes.problem.descriptor",
                                                               refPackage.getQualifiedName(), Integer.valueOf(numClasses),
                                                               Integer.valueOf(limit));
    return new CommonProblemDescriptor[]{
      inspectionManager.createProblemDescriptor(errorString)
    };
  }
@Override
  public CommonProblemDescriptor @Nullable [] checkPackage(@NotNull RefPackage refPackage,
                                                           @NotNull AnalysisScope analysisScope,
                                                           @NotNull InspectionManager inspectionManager,
                                                           @NotNull GlobalInspectionContext globalInspectionContext)