Optimal Statistical Hypothesis Testing for Social Choice