### Question:
ResourceResolverMapTransformerFactory implements TransformerFactory { @Activate protected void activate(final Map<String, Object> config) { final String[] test = PropertiesUtil.toStringArray(config.get(PROP_ATTRIBUTES), new String[]{}); String[] normalizedValue = PropertiesUtil.toStringArray(config.get(PROP_ATTRIBUTES), DEFAULT_ATTRIBUTES); if (test.length == 1 && StringUtils.contains(test[0], ",")) { normalizedValue = StringUtils.split(test[0], ","); } this.attributes = ParameterUtil.toMap(normalizedValue, ":", ","); }  Transformer createTransformer();  }### Answer:
@Test public void activate() throws Exception { }
@Test public void testActivate_Array() throws NoSuchFieldException, IllegalAccessException { ResourceResolverMapTransformerFactory factory = new ResourceResolverMapTransformerFactory(); Field field = factory.getClass().getDeclaredField("attributes"); field.setAccessible(true); Map<String, Object> config = new HashMap<String, Object>(); config.put("attributes", new String[]{"a:b", "c:d"}); factory.activate(config); assertEquals(2, ((Map)field.get(factory)).size()); }
@Test public void testActivate_String() throws NoSuchFieldException, IllegalAccessException { ResourceResolverMapTransformerFactory factory = new ResourceResolverMapTransformerFactory(); Field field = factory.getClass().getDeclaredField("attributes"); field.setAccessible(true); Map<String, Object> config = new HashMap<String, Object>(); config.put("attributes", "a:b,c:d"); factory.activate(config); assertEquals(2, ((Map)field.get(factory)).size()); }