private PsiClass[] getClassImplementations(final PsiClass psiClass, Ref<@Nls String> problemDetected) {
    ArrayList<PsiClass> list = new ArrayList<>();
    Set<String> classNamesWithPotentialImplementations = new LinkedHashSet<>();
    for (PsiClass inheritor : ClassInheritorsSearch.search(psiClass)) {
      if (!inheritor.isInterface() || PsiUtil.isAvailable(JavaFeature.EXTENSION_METHODS, inheritor)) {
        final PsiSubstitutor classSubstitutor = TypeConversionUtil.getClassSubstitutor(psiClass, inheritor, PsiSubstitutor.EMPTY);
        PsiMethod method = classSubstitutor != null ? MethodSignatureUtil.findMethodBySignature(inheritor, myMethod.getSignature(classSubstitutor), true)
                                                    : inheritor.findMethodBySignature(myMethod, true);
        if (method == null) continue;
        PsiClass containingClass = method.getContainingClass();
        if (!psiClass.equals(containingClass)) {
          if (containingClass != null) {
            classNamesWithPotentialImplementations.add(PsiFormatUtil.formatClass(containingClass, PsiFormatUtilBase.SHOW_NAME));
          }
          continue;
        }
        list.add(inheritor);
      }
    }

    if (!classNamesWithPotentialImplementations.isEmpty()) {
      @NlsSafe String classNames = StringUtil.join(classNamesWithPotentialImplementations, ", ");
      problemDetected.set(JavaBundle.message("implement.abstract.method.potential.implementations.with.weaker.access", classNames));
    }
    return list.toArray(PsiClass.EMPTY_ARRAY);
  }
private PsiClass[] getClassImplementations(final PsiClass psiClass, Ref<@Nls String> problemDetected)