AnnotationHandlerCollector { public void removeAnnotationHandler(String handler) { if (handler == null) { throw new NullPointerException("type"); } logger.note(LogLocation.LOG_FILE, "Removing " + handler); Set<String> keys = new LinkedHashSet<>(); for (String key : handlers.keySet()) { if (handler.equals(handlers.get(key))) { keys.add(key); } } for (String key : keys) { handlers.remove(key); } } AnnotationHandlerCollector(Initializer initializer, Logger logger); boolean isModified(); String getAnnotationHandler(String type, String handlerType); void load(); void removeAnnotationHandler(String handler); @Override String toString(); String toList(); Map<String, String> handlers(); void fromList(String input);  }
@Test public void testRemoveAnnotationHandlerNull() { assertThrows(NullPointerException.class, () -> collector.removeAnnotationHandler(null)); }
@Test public void testRemoveAnnotationHandlerWhenEmpty() { collector.removeAnnotationHandler("provider1"); assertEquals(1, logger.records().size()); assertEquals("Removing provider1\n", logger.getFileContent()); }