AbstractVFState extends State { @Override final int nextN(int n) { if (size == 0) return 0; for (int i = n + 1; i < g1.length; i++) if (m1[i] == UNMAPPED && t1[i] > 0) return i; for (int i = n + 1; i < g1.length; i++) if (m1[i] == UNMAPPED) return i; return nMax(); } AbstractVFState(final int[][] g1, final int[][] g2);   }
@Test public void nextNAt0() { AbstractVFState state = create(5, 10); assertThat(state.nextN(-1), is(0)); }
@Test public void nextNTerminal() { AbstractVFState state = create(5, 10); state.size = 2; state.m1[0] = 1; state.m1[1] = 0; state.t1[4] = 1; assertThat(state.nextN(-1), is(4)); }
@Test public void nextNNonTerminal() { AbstractVFState state = create(5, 10); state.size = 2; state.m1[0] = 1; state.m1[1] = 0; assertThat(state.nextN(-1), is(2)); }