### Question:
ContextualPreferenceManager { @Transactional public ContextualPreference delete(final String name, final ContextualPreferenceExternalResource resource) { validateName(name); validateResource(resource); final ContextualPreference preference = load(name, resource); contextualPreferenceDao.delete(name, resource); return preference; }  List<ContextualPreference> loadAll(); ContextualPreference load(final String name, final ContextualPreferenceExternalResource resource); ContextualPreference search(final List<String> preferences,
                                       final ContextualPreferenceExternalResource resource); ContextualPreference search(final List<String> preferences); @Transactional ContextualPreference upsert(final ContextualPreferenceVO preferenceVO); @Transactional ContextualPreference delete(final String name, final ContextualPreferenceExternalResource resource);  }### Answer:
@Test public void deleteShouldFailIfThereIsNoSuchPreference() { assertThrows(() -> manager.delete(NAME, toolResource)); }
@Test public void deleteShouldFailIfSomeOfParametersAreEmpty() { assertThrows(IllegalArgumentException.class, () -> manager.delete(null, toolResource)); assertThrows(IllegalArgumentException.class, () -> manager.delete(NAME, null)); assertThrows(IllegalArgumentException.class, () -> manager.delete(NAME, new ContextualPreferenceExternalResource(null, TOOL_ID))); assertThrows(IllegalArgumentException.class, () -> manager.delete(NAME, new ContextualPreferenceExternalResource(LEVEL, null))); }