Proving a class of hypergeometric identities by means of generating functions