Physiology

A couple comes for evaluation of infeility. The HSG was normal but semen analysis revealed azoospermia. What is the diagnostic test to differentiate between testicular failure and vas deferens obstruction?