TypeCollector { public void removeProvider(String provider) { if (provider == null) { throw new NullPointerException("provider"); } logger.note(LogLocation.LOG_FILE, "Removing " + provider); removed.add(provider); for (Type type : types.values()) { type.removeProvider(provider); } } TypeCollector(Initializer initializer, Logger logger); void cache(); boolean isModified(); Type getType(String type); Collection<Type> types(); void removeProvider(String provider); @Override String toString();  }
@Test public void testRemoveProviderNull() { assertThrows(NullPointerException.class, () -> collector.removeProvider(null)); }
@Test public void testRemoveProviderWhenEmpty() { collector.removeProvider("provider1"); assertEquals(1, logger.records().size()); assertEquals("Removing provider1\n", logger.getFileContent()); }