Consider a patent licensee. It is quite possible that the expected royalty payments, cost of challenge (post grant, inter partes, or ex parte reexam), and probability of invalidation would justify a validity challenge (i.e. expected value >$0). For example, if the expected lifetime royalties may amount to a few million, the cost of a challenge was $100k, and the probability of invalidation may be 20%, it would probably make sense to challenge.
Is this done in practice? Are there traditional license terms that forbid this? Does the challenging licensee lose credibility in the case given that they were concerned enough to sign a license in the first place?
I have read that validity challenges are usually initiated by those being sued for infringement, but it seems like a valid action for a licensee as well.