@Test
public void sort() {

    int[] org = new int[]{1, 2, 3, 4};
    assertThat(Topology.sort(org, new int[]{0, 1, 2, 3, 4}),
               is(not(sameInstance(org))));
    assertThat(Topology.sort(org, new int[]{0, 1, 2, 3, 4}),
               is(new int[]{1, 2, 3, 4}));
    assertThat(Topology.sort(org, new int[]{0, 2, 1, 3, 4}),
               is(new int[]{2, 1, 3, 4}));
    // non-sequential
    assertThat(Topology.sort(org, new int[]{0, 2, 1, 7, 4}),
               is(new int[]{2, 1, 4, 3}));
}