@Test
public void testCreateModelBody() {

    Template template = createMock(Template.class);
    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);
    @SuppressWarnings("unchecked")
    Map<String, TemplateModel> params = createMock(Map.class);
    TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class);
    replay(params, body);
    FreemarkerAutotagRuntime runtime = new FreemarkerAutotagRuntime();
    runtime.execute(env, params, new TemplateModel[0], body);
    ModelBody modelBody = runtime.createModelBody();
    assertTrue(modelBody instanceof FreemarkerModelBody);
    verify(template, rootDataModel, out, params, body);
}