void (Collection<? extends VcsRef> unsorted, List<? extends VcsRef> expected) { // for the sake of simplicity we check only names of references List<VcsRef> actual = sort(unsorted); assertEquals("Collections size don't match", expected.size(), actual.size()); for (int i = 0; i < actual.size(); i++) { assertEquals("Incorrect element at place " + i, expected.get(i).getName(), actual.get(i).getName()); } }