Comparators { public static Comparator<? super DomainProvider> forDomainProvider() { return new DomainProviderComparator(); } private  Comparators(); static Comparator<? super DomainProvider> forDomainProvider(); static Comparator<? super ConnectorProvider> forConnectorProvider();  }
@Test public void testDomainProviderComparator_shouldSortDomainProviders() throws Exception { List<DomainProvider> list = Arrays.asList(mockDomainProvider("z"), mockDomainProvider("b"), mockDomainProvider("1")); Collections.sort(list, Comparators.forDomainProvider()); assertThat(list.get(0).getId(), is("1")); assertThat(list.get(1).getId(), is("b")); assertThat(list.get(2).getId(), is("z")); }