AbstractVFState extends State { @Override final int nextM(int n, int m) { if (size == 0) return m + 1; for (int i = m + 1; i < g2.length; i++) if (m2[i] == UNMAPPED && (t1[n] == 0 || t2[i] > 0)) return i; return mMax(); } AbstractVFState(final int[][] g1, final int[][] g2);   }
@Test public void nextMAt0() { AbstractVFState state = create(5, 10); assertThat(state.nextM(0, -1), is(0)); assertThat(state.nextM(0, 0), is(1)); assertThat(state.nextM(0, 1), is(2)); assertThat(state.nextM(0, 2), is(3)); }
@Test public void nextMTerminal() { AbstractVFState state = create(5, 10); state.size = 2; state.m2[0] = 1; state.m2[1] = 0; state.t1[1] = 1; state.t2[4] = 1; assertThat(state.nextM(1, -1), is(4)); }
@Test public void nextMNonTerminal() { AbstractVFState state = create(5, 10); state.size = 2; state.m2[0] = 1; state.m2[1] = 0; assertThat(state.nextM(0, -1), is(2)); }