TemplateHashModel rootDataModel = createMock(TemplateHashModel.class);
Writer out = createMock(Writer.class);
expect(template.getMacros()).andReturn(new HashMap<String, Macro>());
replay(template, rootDataModel, out);
Environment env = new Environment(template, rootDataModel, out);
TemplateNumberModel model = createMock(TemplateNumberModel.class);
expect(model.getAsNumber()).andReturn(new Integer(42)).anyTimes();
@SuppressWarnings("unchecked")
Map<String, TemplateModel> params = createMock(Map.class);
TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class);
expect(params.get(eq("notnullParam"))).andReturn(model).anyTimes();
expect(params.get(eq("nullParam"))).andReturn(null).anyTimes();