@Test
public void testEncode_NoPermutation() {

    PermutationParity permutation = mock(PermutationParity.class);
    GeometricParity geometric = mock(GeometricParity.class);
    when(permutation.parity(any(long[].class))).thenReturn(0);
    when(geometric.parity()).thenReturn(+1);
    StereoEncoder encoder = new GeometryEncoder(new int[]{1, 3}, permutation, geometric);
    long[] prev = new long[6];
    long[] result = new long[6];
    Arrays.fill(prev, 1);
    Arrays.fill(result, 1);
    // check returned false, the permutation changes for each cycle
    assertFalse(encoder.encode(prev, result));
    // check no values modified
    assertThat(result, is(new long[]{1, 1, 1, 1, 1, 1}));
    // geometric parity should not be called
    verify(geometric, never()).parity();
}