### Question:
ServletContextAttributeHelper { final void setAttribute(final Attribute attribute, final Object object) { Validate.notNull(attribute); LOG.debug("setting attribute: {} with value: {}", attribute, object); Validate.isTrue(attribute.isValid(object), object + " is not of valid subType for attribute: " + attribute); servletContext.setAttribute(getAttributeName(attribute), object); } ServletContextAttributeHelper(final ServletContext servletContext);  ServletContextAttributeHelper(final ServletContext servletContext, final String name); static ServletContextAttributeHelper create(final FilterConfig filterConfig); WroManagerFactory getManagerFactory(); WroConfiguration getWroConfiguration(); void setWroConfiguration(final WroConfiguration config); void setManagerFactory(final WroManagerFactory managerFactory); void clear(); static final String DEFAULT_NAME; }### Answer:
@Test(expected = NullPointerException.class) public void cannotSetObjectForNullAttribute() { victim.setAttribute(null, null); }
@Test public void shouldSetNullAttribute() { victim.setAttribute(Attribute.CONFIGURATION, null); }
@Test(expected = IllegalArgumentException.class) public void cannotStoreAttributeOfInvalidType() { victim.setAttribute(Attribute.MANAGER_FACTORY, "invalid type"); }
@Test public void shouldStoreAttributeOfValidType() { victim.setAttribute(Attribute.CONFIGURATION, new WroConfiguration()); }
@Test public void shouldStoreAttributeOfValidSubType() { victim.setAttribute(Attribute.MANAGER_FACTORY, new BaseWroManagerFactory()); }