### Question:
ProviderService implements EntityService { @SuppressWarnings("unchecked") public static Map<String, Map<String, Object>> extractAllContentTypes(Map<String, Object> providerDef) { try { Map<String, Map<String, Object>> types = (Map<String, Map<String, Object>>) providerDef.get(TYPE); return types; } catch (ClassCastException e) { throw new SettingsException("Incorrect configuration for provider '" + providerDef.get(NAME) + "' when trying to retrieve all sys_provider_type configurations."); } }  boolean authenticate(String providerName, String password); boolean isSuperProvider(String providerName); ProviderContentTypeInfo findContentType(String typeName); Map<String, Object> findProvider(String providerName); @Override String create(Map<String, Object> entity); @Override void create(String id, Map<String, Object> entity); @Override List<Map<String, Object>> getAll(); @Override StreamingOutput getAll(Integer from, Integer size, String[] fieldsToRemove); @Override Map<String, Object> get(String id); @Override void update(String id, Map<String, Object> entity); @Override void delete(String id); void flushCaches(); List<Map<String, String>> runPreprocessors(String typeName, List<Map<String, Object>> preprocessorsDef,
			Map<String, Object> content); String generateSysId(String type, String contentId); String parseTypeNameFromSysId(String contentSysId); @SuppressWarnings("unchecked") static Map<String, Object> extractContentType(Map<String, Object> providerDef, String typeName); @SuppressWarnings("unchecked") static Map<String, Map<String, Object>> extractAllContentTypes(Map<String, Object> providerDef); @SuppressWarnings("unchecked") static List<Map<String, Object>> extractPreprocessors(Map<String, Object> typeDef, String typeName); static List<Map<String, Object>> extractPreprocessors(ProviderContentTypeInfo typeInfo, String typeName); @SuppressWarnings("unchecked") static String extractIndexName(Map<String, Object> typeDef, String typeName); static String extractIndexName(ProviderContentTypeInfo typeInfo, String typeName); @SuppressWarnings("unchecked") static String[] extractSearchIndices(Map<String, Object> typeDef, String typeName); static String[] extractSearchIndices(ProviderContentTypeInfo typeInfo, String typeName); static Collection<String> extractTypeVisibilityRoles(ProviderContentTypeInfo typeInfo, String typeName); static Collection<String> extractTypeVisibilityRoles(Map<String, Object> typeDef, String typeName); @SuppressWarnings("unchecked") static String extractIndexType(Map<String, Object> typeDef, String typeName); static String extractIndexType(ProviderContentTypeInfo typeInfo, String typeName); static String extractSysType(Map<String, Object> typeDef, String typeName); @SuppressWarnings("unchecked") static Map<String, Object> extractIndexerConfiguration(Map<String, Object> typeDef, String typeName); static String extractSysContentContentType(Map<String, Object> typeDef, String typeName); static boolean extractSearchAllExcluded(Map<String, Object> typeDef); static boolean extractPersist(Map<String, Object> typeDef); @Override ListRequest listRequestInit(); @Override ListRequest listRequestNext(ListRequest previous); static final String NAME; static final String PASSWORD_HASH; static final String SUPER_PROVIDER; static final String TYPE; static final String INDEX; static final String INDEXER; static final String SYS_TYPE; static final String SYS_VISIBLE_FOR_ROLES; static final String INPUT_PREPROCESSORS; static final String SEARCH_INDICES; static final String SEARCH_ALL_EXCLUDED; static final String PERSIST; static final String SYS_CONTENT_CONTENT_TYPE; }### Answer:
@Test public void extractAllContentTypes() { Map<String, Object> providerDef = new HashMap<String, Object>(); Assert.assertNull(ProviderService.extractAllContentTypes(providerDef)); Map<String, Object> types = new HashMap<String, Object>(); providerDef.put(ProviderService.TYPE, types); Assert.assertEquals(types, ProviderService.extractAllContentTypes(providerDef)); providerDef.put(ProviderService.TYPE, "baaad"); try { ProviderService.extractAllContentTypes(providerDef); Assert.fail("SettingsException expected"); } catch (SettingsException e) { } }