Service { String toProviderNamesList() { StringBuilder sb = new StringBuilder(); List<String> names = new ArrayList<String>(providers); Collections.sort(names); for (String provider : names) { sb.append(provider).append("\n"); } return sb.toString(); } Service(Logger logger, String name); @Override String toString();  }
@Test public void testToProviderNameListNoProviders() { Service service = new Service(logger, "service1"); String result = service.toProviderNamesList(); Assert.assertEquals("", result); }