public static @NotNull TypeConstraints.TypeConstraintFactory typeConstraintFactory(@NotNull PsiElement context) {
    JavaPsiFacade facade = JavaPsiFacade.getInstance(context.getProject());
    GlobalSearchScope scope = context.getResolveScope();
    return fqn -> {
      PsiClass psiClass = facade.findClass(fqn, scope);
      return psiClass == null ? TypeConstraints.unresolved(fqn) : TypeConstraints.exactClass(psiClass);
    };
  }
public static @NotNull TypeConstraints.TypeConstraintFactory typeConstraintFactory(@NotNull PsiElement context)