ObjectWrapper objectWrapper = createMock(ObjectWrapper.class);
Writer writer = new StringWriter();
expect(template.getMacros()).andReturn(new HashMap<Object, Object>());
expect(template.getObjectWrapper()).andReturn(objectWrapper);
expect(objectWrapper.wrap("value")).andReturn(valueModel);
replay(template, model, valueModel, configuration, objectWrapper);
Environment env = new Environment(template, model, writer);
EnvironmentScopeExtractor extractor = new EnvironmentScopeExtractor(env);
extractor.setValue("key", "value");