@Test
public void sortAlreadySortedTest() {

    List<String> people = Arrays.asList("One", "Two", "Three");
    int[] ranks = {1, 2, 3};
    int[] sortedRanks = {1, 2, 3};
    people = RankSorter.sort(people, ranks);
    // assertEquals doesn't work on primitive arrays
    // see http://code.google.com/p/testng/issues/detail?id=4
    for (int i = 0; i < people.size(); i++) {
        assertEquals(String.format("Different at index %d. Expected <%d>, was <%d>.", i, sortedRanks[i], ranks[i]), ranks[i], sortedRanks[i]);
    }
    assertEquals(people, Arrays.asList("One", "Two", "Three"));
}