@Override
  public ProblemDescriptor @Nullable [] checkClass(@NotNull final PsiClass aClass,
                                                   @NotNull final InspectionManager manager,
                                                   final boolean isOnTheFly) {
    if (aClass instanceof PsiTypeParameter || aClass.isEnum()) {
      return null;
    }

    final Pair<PsiClass, PsiElement> superClassAndPlace = getSuperIfOnlyOne(aClass);
    if (superClassAndPlace == null) return null;

    PsiClass superClass = superClassAndPlace.getFirst();
    long ms = System.currentTimeMillis();
    final List<ClassAndInheritorCount> topInheritors = getTopInheritorsUsingCompilerIndices(superClass, aClass.getResolveScope(), aClass);
    if (LOG.isDebugEnabled()) {
      LOG.debug("search for inheritance structure of " + superClass.getQualifiedName() + " in " + (System.currentTimeMillis() - ms) + " ms");
    }
    if (topInheritors.isEmpty()) return null;

    final Collection<LocalQuickFix> topInheritorsQuickFix = new ArrayList<>(topInheritors.size());
    for (final ClassAndInheritorCount searchResult : topInheritors) {
      PsiClass psi = searchResult.psi;
      if (InheritanceUtil.isInheritorOrSelf(psi, aClass, true)) {
        continue;
      }
      final LocalQuickFix quickFix = new ChangeSuperClassFix(psi,
                                                             superClass,
                                                             searchResult.number,
                                                             searchResult.psi.isInterface() && !aClass.isInterface());
      topInheritorsQuickFix.add(quickFix);
      if (topInheritorsQuickFix.size() >= MAX_RESULT) {
        break;
      }
    }

    PsiElement highlightingElement;
    if (aClass.getFields().length == 0 &&
        aClass.getMethods().length == 0 &&
        aClass.getInnerClasses().length == 0 &&
        aClass.getInitializers().length == 0) {
      highlightingElement = aClass;
    }
    else if (aClass instanceof PsiAnonymousClass) {
      highlightingElement = ((PsiAnonymousClass)aClass).getBaseClassReference();
    }
    else {
      highlightingElement = superClassAndPlace.getSecond();
    }

    return new ProblemDescriptor[]{manager
      .createProblemDescriptor(highlightingElement,
                               JavaCompilerBundle.message("class.can.have.more.common.super.class"),
                               isOnTheFly,
                               topInheritorsQuickFix.toArray(LocalQuickFix.EMPTY_ARRAY),
                               ProblemHighlightType.GENERIC_ERROR_OR_WARNING)};
  }
@Override
  public ProblemDescriptor @Nullable [] checkClass(@NotNull final PsiClass aClass,
                                                   @NotNull final InspectionManager manager,
                                                   final boolean isOnTheFly)