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);