CachingTilesContainer extends TilesContainerWrapper implements MutableTilesContainer { public CachingTilesContainer(TilesContainer originalContainer) { super(originalContainer); definitionsAttributeName = DEFAULT_DEFINITIONS_ATTRIBUTE_NAME; } CachingTilesContainer(TilesContainer originalContainer);  CachingTilesContainer(TilesContainer originalContainer, String definitionsAttributeName); Definition getDefinition(String definition,
            Request request); @Override boolean isValidDefinition(String definition, Request request); @Override void register(Definition definition, Request request); @Override void render(String definition, Request request);  }
@SuppressWarnings("unchecked") @Test public void testCachingTilesContainer() { Request request = createMock(Request.class); Map<String, Definition> definitions = createMock(Map.class); Map<String, Object> scope = createMock(Map.class); Definition definition = createMock(Definition.class); TilesContainer wrapped = createMock(TilesContainer.class); expect(request.getContext("request")).andReturn(scope); expect(scope.get(DEFAULT_DEFINITIONS_ATTRIBUTE_NAME)).andReturn( definitions); expect(definitions.get("definition")).andReturn(definition); replay(wrapped, request, definitions, scope, definition); CachingTilesContainer container = new CachingTilesContainer(wrapped, null); assertSame(definition, container.getDefinition("definition", request)); verify(wrapped, request, definitions, scope, definition); }