General Theory of Hypothesis Testing