private void assertSortedNames(final String... names) {
        final ArrayList<Geocache> caches = new ArrayList<>(names.length);
        for (final String name : names) {
            caches.add(new NamedCache(name));
        }
        Collections.sort(caches, comp);
        for (int i = 0; i < caches.size(); i++) {
            assertThat(caches.get(i).getName()).isEqualTo(names[i]);
        }
    }
Assert that a given collection of names is already sorted correctly.
main/src/test/java/cgeo/geocaching/sorting/NameComparatorTest.java