### Question:
ArchetypePreferencesManager { boolean containsArchetype(final String archetype) { return archetypePreferences.getArchetypeSelectionMap().containsKey(archetype); } 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 containsArchetypeTrueTest() { final Map<String, Boolean> archetypeSelectionMap = new HashMap<>(); archetypeSelectionMap.put("archetype", true); doReturn(archetypeSelectionMap).when(archetypePreferences).getArchetypeSelectionMap(); assertTrue(archetypePreferencesManager.containsArchetype("archetype")); }
@Test public void containsArchetypeFalseTest() { final Map<String, Boolean> archetypeSelectionMap = new HashMap<>(); archetypeSelectionMap.put("archetype", true); doReturn(archetypeSelectionMap).when(archetypePreferences).getArchetypeSelectionMap(); assertFalse(archetypePreferencesManager.containsArchetype("other")); }