@Test
public void testParity_All() throws Exception {

    assertEquals(1, permutationParity.parity(new long[]{1, 2, 3, 4}));
    assertEquals(-1, permutationParity.parity(new long[]{2, 1, 3, 4}));
    assertEquals(-1, permutationParity.parity(new long[]{1, 3, 2, 4}));
    assertEquals(1, permutationParity.parity(new long[]{3, 1, 2, 4}));
    assertEquals(1, permutationParity.parity(new long[]{2, 3, 1, 4}));
    assertEquals(-1, permutationParity.parity(new long[]{3, 2, 1, 4}));
    assertEquals(-1, permutationParity.parity(new long[]{1, 2, 4, 3}));
    assertEquals(1, permutationParity.parity(new long[]{2, 1, 4, 3}));
    assertEquals(1, permutationParity.parity(new long[]{1, 4, 2, 3}));
    assertEquals(-1, permutationParity.parity(new long[]{4, 1, 2, 3}));
    assertEquals(-1, permutationParity.parity(new long[]{2, 4, 1, 3}));
    assertEquals(1, permutationParity.parity(new long[]{4, 2, 1, 3}));
    assertEquals(1, permutationParity.parity(new long[]{1, 3, 4, 2}));
    assertEquals(-1, permutationParity.parity(new long[]{3, 1, 4, 2}));
    assertEquals(-1, permutationParity.parity(new long[]{1, 4, 3, 2}));
    assertEquals(1, permutationParity.parity(new long[]{4, 1, 3, 2}));
    assertEquals(1, permutationParity.parity(new long[]{3, 4, 1, 2}));
    assertEquals(-1, permutationParity.parity(new long[]{4, 3, 1, 2}));
    assertEquals(-1, permutationParity.parity(new long[]{2, 3, 4, 1}));
    assertEquals(1, permutationParity.parity(new long[]{3, 2, 4, 1}));
    assertEquals(1, permutationParity.parity(new long[]{2, 4, 3, 1}));
    assertEquals(-1, permutationParity.parity(new long[]{4, 2, 3, 1}));
    assertEquals(-1, permutationParity.parity(new long[]{3, 4, 2, 1}));
    assertEquals(1, permutationParity.parity(new long[]{4, 3, 2, 1}));
}