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();
replay(model, params, body);
FreemarkerAutotagRuntime runtime = new FreemarkerAutotagRuntime();
runtime.execute(env, params, new TemplateModel[0], body);
Object notnullParam = runtime.getParameter("notnullParam", Object.class, null);
Object nullParam = runtime.getParameter("nullParam", Object.class, null);
int notnullParamDefault = runtime.getParameter("notnullParam", Integer.class, new Integer(24));
int nullParamDefault = runtime.getParameter("nullParam", Integer.class, new Integer(24));
assertEquals(42, notnullParam);
assertEquals(null, nullParam);
assertEquals(42, notnullParamDefault);
assertEquals(24, nullParamDefault);
verify(template, rootDataModel, out, model, params, body);