### Question:
ArchetypePreferencesManager { public void removeArchetype(final String archetype) { archetypePreferences.load(); if (removeArchetypePreference(archetype)) { archetypePreferences.save(getGlobalScope()); } getOuIdentifiers().forEach(identifier -> { final PreferenceScopeResolutionStrategyInfo info = workbenchPreferenceScopeResolutionStrategies.getSpaceInfoFor(identifier); archetypePreferences.load(info); if (removeArchetypePreference(archetype)) { archetypePreferences.save(info); } }); } ArchetypePreferencesManager(); @Inject  ArchetypePreferencesManager(final PreferenceScopeFactory scopeFactory,
                                       final WorkbenchPreferenceScopeResolutionStrategies workbenchPreferenceScopeResolutionStrategies,
                                       final ArchetypePreferences archetypePreferences,
                                       final OrganizationalUnitService ouService); void addArchetype(final String archetype); void removeArchetype(final String archetype); void setDefaultArchetype(final String archetype); void initializeCustomPreferences(); void initializeCustomPreference(final String identifier); void enableArchetype(final String archetype,
                                final boolean isEnabled,
                                final boolean customIncluded);  }### Answer:
@Test public void removeArchetypeTest() { doReturn(true).when(archetypePreferencesManager).containsArchetype(ARCHETYPE_ALIAS); archetypePreferencesManager.removeArchetype(ARCHETYPE_ALIAS); verify(archetypePreferences).load(); verify(archetypePreferences).save(any(PreferenceScope.class)); verify(workbenchPreferenceScopeResolutionStrategies, times(3)).getSpaceInfoFor(anyString()); verify(archetypePreferences, times(3)).load(any(PreferenceScopeResolutionStrategyInfo.class)); verify(archetypePreferences, times(3)).save(any(PreferenceScopeResolutionStrategyInfo.class)); }