Collector { Service getService(String service) { if (service == null) { throw new NullPointerException("service"); } if (!services.containsKey(service)) { Service newService = new Service(logger, service); CharSequence initialData = initializer.initialData(service); if (initialData != null) { newService.fromProviderNamesList(initialData.toString()); for (String provider : removed) { newService.removeProvider(provider); } } services.put(service, newService); } return services.get(service); } Collector(Initializer initializer, Logger logger); @Override String toString();  }
@Test(expected=NullPointerException.class) public void testGetServiceNull() { collector.getService(null); }