### Question:
VelocityStyleTilesTool extends ContextHolder { public VelocityStyleTilesTool setCurrentContainer(String containerKey) { Request velocityRequest = createVelocityRequest( getServletContext(), null); TilesAccess.setCurrentContainer(velocityRequest, containerKey); return this; }  Attribute get(String key); Attribute createAttribute(); Attribute clone(Attribute attribute); Attribute createTemplateAttribute(String template); Renderable render(final Attribute attribute); Renderable renderDefinition(final String definitionName); Renderable renderAttributeContext(); AttributeContext startAttributeContext(); VelocityStyleTilesTool endAttributeContext(); AttributeContext getAttributeContext(); VelocityStyleTilesTool setCurrentContainer(String containerKey); @Override String toString();  }### Answer:
@Test public void testSetCurrentContainer() { TilesContainer container = createMock(TilesContainer.class); ApplicationContext applicationContext = createMock(ApplicationContext.class); Map<String, Object> applicationScope = new HashMap<String, Object>(); applicationScope.put("myKey", container); Map<String, Object> requestScope = new HashMap<String, Object>(); requestScope.put(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME, container); request.setAttribute(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME, container); expect(request.getAttribute(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(container); expect(applicationContext.getApplicationScope()).andReturn(applicationScope).anyTimes(); expect(servletContext.getAttribute(ApplicationAccess .APPLICATION_CONTEXT_ATTRIBUTE)).andReturn(applicationContext) .anyTimes(); replay(velocityContext, request, response, servletContext, container, applicationContext); initializeTool(); assertEquals(tool, tool.setCurrentContainer("myKey")); assertEquals(container, requestScope.get(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME)); verify(velocityContext, request, response, servletContext, container, applicationContext); }