@Test
public void testOrdering() throws Exception {

    // Already in order
    List<Character> ordered = GraphExt.order(Arrays.asList('A', 'B', 'C'), (s1, s2) -> s1 == 'A' && s2 == 'C');
    assertThat(ordered).containsExactlyInAnyOrder('A', 'B', 'C');
    // Out of order
    List<Character> notOrdered = GraphExt.order(Arrays.asList('A', 'B', 'C'), (s1, s2) -> s1 == 'C' && s2 == 'A');
    assertThat(notOrdered).containsExactlyInAnyOrder('B', 'C', 'A');
}