public static boolean isInstantiable(@NotNull PsiClass psiClass) {
    if (psiClass instanceof PsiTypeParameter ||
        psiClass.hasModifierProperty(PsiModifier.PRIVATE) ||
        psiClass.hasModifierProperty(PsiModifier.ABSTRACT)) {
      return false;
    }

    if (psiClass.getContainingClass() != null &&
        !psiClass.hasModifierProperty(PsiModifier.STATIC)) {
      return false;
    }

    PsiMethod[] constructors = psiClass.getConstructors();
    if (constructors.length == 0) return true;

    // e.g., Project / Project, CoroutineScope
    for (PsiMethod constructor : constructors) {
      int parametersCount = constructor.getParameterList().getParametersCount();
      if (parametersCount <= 2) {
        return true;
      }
    }
    return false;
  }
public static boolean isInstantiable(@NotNull PsiClass psiClass)