On asymptotically optimal tests