Added unit test for HMM.