@Test
public void testViterbiAlgorithm() {

  // initialize the expected hidden sequence
  int[] expected = {2, 0, 3, 3, 0, 0, 2};
  // fetch the viterbi generated sequence
  int[] computed = HmmAlgorithms.viterbiAlgorithm(getModel(), getSequence(), false);
  // first make sure we return the correct size
  assertNotNull(computed);
  assertEquals(computed.length, getSequence().length);
  // now check the contents
  for (int i = 0; i < getSequence().length; ++i) {
    assertEquals(expected[i], computed[i]);
  }
}