Hidden Markov Model - Java