@Test
public void permutationParity() {

    assertThat(Topology.parity(new int[]{0, 1, 2, 3},
                               new int[]{0, 1, 2, 3}), is(1));   // even
    assertThat(Topology.parity(new int[]{0, 1, 2, 3},
                               new int[]{0, 1, 3, 2}), is(-1));  // swap 2,3 = odd
    assertThat(Topology.parity(new int[]{0, 1, 2, 3},
                               new int[]{1, 0, 3, 2}), is(1));   // swap 0,1 = even
    assertThat(Topology.parity(new int[]{0, 1, 2, 3},
                               new int[]{2, 0, 3, 1}), is(-1));  // swap 0,3 = odd
}