public static boolean isUtilityClass(@NotNull PsiClass aClass, boolean fullCheck, boolean ignoreMainMethod) {
    if (aClass.isInterface() || aClass.isEnum() || aClass.isAnnotationType() || aClass.isRecord()) {
      return false;
    }
    if (aClass instanceof PsiTypeParameter || aClass instanceof PsiAnonymousClass) {
      return false;
    }
    final PsiReferenceList extendsList = aClass.getExtendsList();
    if (fullCheck && extendsList != null && extendsList.getReferencedTypes().length > 0) {
      return false;
    }
    final PsiReferenceList implementsList = aClass.getImplementsList();
    if (implementsList != null && implementsList.getReferencedTypes().length > 0) {
      return false;
    }
    final int staticMethodCount = countStaticMethods(aClass.getMethods(), ignoreMainMethod);
    if (staticMethodCount < 0) {
      return false;
    }
    final int staticFieldCount = countStaticFields(aClass.getFields());
    if (staticFieldCount < 0) {
      return false;
    }
    if (fullCheck) {
      for (ImplicitSubclassProvider subclassProvider : ImplicitSubclassProvider.EP_NAME.getExtensionList()) {
        if (subclassProvider.isApplicableTo(aClass) && subclassProvider.getSubclassingInfo(aClass) != null) {
          return false;
        }
      }
    }
    return !fullCheck || staticMethodCount != 0 || staticFieldCount != 0;
  }
public static boolean isUtilityClass(@NotNull PsiClass aClass, boolean fullCheck, boolean ignoreMainMethod)