### Question:
WorkItemDefinitionRegistries { public WorkItemDefinitionCacheRegistry remove(final T item) { final WorkItemDefinitionCacheRegistry removed = registryMap.remove(keyProvider.apply(item)); registryDestroyer.accept(removed); return removed; } WorkItemDefinitionRegistries(final Function<T, String> keyProvider,
                                        final Map<String, WorkItemDefinitionCacheRegistry> registryMap,
                                        final Consumer<WorkItemDefinitionCacheRegistry> registryDestroyer); boolean contains(final T item); Function<T, WorkItemDefinitionCacheRegistry> registries(); @SuppressWarnings("all") void clear(); WorkItemDefinitionCacheRegistry put(final T item,
                                               final WorkItemDefinitionCacheRegistry registry); WorkItemDefinitionCacheRegistry remove(final T item);  }### Answer:
@Test public void testRemove() { tested.put("1", registry1); tested.put("2", registry2); assertTrue(tested.contains("1")); assertTrue(tested.contains("2")); tested.remove("1"); verify(registryDestroyer, times(1)).accept(eq(registry1)); assertFalse(tested.contains("1")); assertTrue(tested.contains("2")); tested.remove("2"); verify(registryDestroyer, times(1)).accept(eq(registry2)); assertFalse(tested.contains("1")); assertFalse(tested.contains("2")); }