AbstractVFState extends State { @Override int[] mapping() { return Arrays.copyOf(m1, m1.length); } AbstractVFState(final int[][] g1, final int[][] g2);   }
@Test public void copyMapping() { int[][] g1 = new int[][]{{1}, {0, 2}, {1, 3}, {2}}; int[][] g2 = new int[][]{{1}, {0, 2}, {1, 3}, {2, 4}, {3, 5}, {4}}; AbstractVFState state = create(g1, g2); state.m1[0] = 1; state.m1[1] = 2; state.m1[2] = 5; state.m1[3] = 6; assertThat(state.mapping(), is(state.m1)); assertThat(state.mapping(), is(not(sameInstance(state.m1)))); }