When caffeine or another methylxanthine is applied to a cell, it inhibits the activity of cAMP-PDE (phosphodiesterase enzyme) by binding to the site of the enzyme that usually binds the adenine of cAMP, such that cAMP-PDE can no longer convert cAMP to AMP. The result being that any cAMP generated by adenylate cyclase will remain active in the cell for longer than usual.
Increases in cAMP lead to a stimulation of the luteinizing hormone, and thus an increase in testosterone production.
Or at least that's what I put together from Google. . .