boolean (@Nullable PsiExpression expression) { if (expression == null) { return false; } final PsiType type = expression.getType(); if (!(type instanceof PsiClassType classType)) { return false; } final PsiClassType javaLangClassType = TypeUtils.getType(CommonClassNames.JAVA_LANG_CLASS, expression); if (!javaLangClassType.isAssignableFrom(classType)) { return false; } final PsiType[] parameters = classType.getParameters(); if (parameters.length == 0) { return true; } if (parameters.length > 1) { return false; } final PsiType parameterType = parameters[0]; if (isNonPrivateClassType(parameterType)) { return true; } if (!(parameterType instanceof PsiCapturedWildcardType capturedWildcardType)) { return false; } final PsiWildcardType wildcardType = capturedWildcardType.getWildcard(); final PsiType extendsBoundType = wildcardType.getExtendsBound(); return isNonPrivateClassType(extendsBoundType); }