The Prostate Cancer Prevention Trial ( PCPT ) was a 7-year randomized , double-blind , placebo-controlled trial of the efficacy of finasteride for the prevention of prostate cancer with a primary outcome of histologically determined prevalence of prostate cancer at the end of 7 years .