### Question:
CORSWithCredentialsFilter implements Filter { @SuppressWarnings("unchecked") protected List<String> getConfigList(Map<String, Object> config, Object cfgKeyOrigins) { if (config != null) { try { List<String> l = (List<String>) config.get(cfgKeyOrigins); if (l == null || l.isEmpty()) return null; return l; } catch (ClassCastException e) { log.warning("Invalid configuration in file " + ConfigService.CFGNAME_SECURITY_RESTAPI_CORS + " for key " + cfgKeyOrigins); } } return null; }  @Override void init(FilterConfig filterConfig); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain chain); @Override void destroy(); static final String OPTIONS; static final String GET; static final String POST; static final String PUT; static final String DELETE; static final String HEADER_ORIGIN; static final String ACCESS_CONTROL_ALLOW_ORIGIN; static final String ACCESS_CONTROL_ALLOW_CREDENTIALS; static final String ACCESS_CONTROL_ALLOW_HEADERS; static final String ACCESS_CONTROL_ALLOW_METHODS; static final String ACCESS_CONTROL_MAX_AGE; static final String ACCESS_CONTROL_ALLOW_HEADERS_VALUE; static final String ACCESS_CONTROL_MAX_AGE_VALUE; static final Object CFG_KEY_ORIGINS; static final Object CFG_KEY_ORIGINS_WITH_CREDENTIALS; }### Answer:
@Test public void getConfigList() { CORSWithCredentialsFilter tested = getTested(); Assert.assertNull(tested.getConfigList(null, KEY)); Map<String, Object> config = new HashMap<>(); Assert.assertNull(tested.getConfigList(config, KEY)); config.put(KEY, "aaa"); Assert.assertNull(tested.getConfigList(config, KEY)); List<String> list = new ArrayList<>(); config.put(KEY, list); Assert.assertNull(tested.getConfigList(config, KEY)); list.add("aaa"); Assert.assertEquals(list, tested.getConfigList(config, KEY)); }