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