public static @Nullable PsiClass resolveFunctionalInterfaceClass(@NotNull PsiFunctionalExpression expression) {
    // First try to avoid substitution
    PsiType type = expression.getGroundTargetType(getFunctionalInterfaceType(expression, false));
    PsiClass actualClass = PsiUtil.resolveClassInClassTypeOnly(type);
    if (actualClass instanceof PsiTypeParameter) {
      // Rare case when function is resolved to a type parameter: perform substitution then
      return PsiUtil.resolveClassInClassTypeOnly(expression.getFunctionalInterfaceType());
    }
    return actualClass;
  }
public static @Nullable PsiClass resolveFunctionalInterfaceClass(@NotNull PsiFunctionalExpression expression)