@Test
public void testGetParameter() {

    InternalContextAdapter context = createMock(InternalContextAdapter.class);
    Writer writer = createMock(Writer.class);
    Node node = createMock(Node.class);
    ASTMap astMap = createMock(ASTMap.class);
    @SuppressWarnings("unchecked")
    Map<String, Object> params = createMock(Map.class);
    expect(node.jjtGetChild(0)).andReturn(astMap);
    expect(astMap.value(context)).andReturn(params);
    expect(params.get(eq("notnullParam"))).andReturn(new Integer(42)).anyTimes();
    expect(params.get(eq("nullParam"))).andReturn(null).anyTimes();
    replay(context, writer, node, astMap, params);
    VelocityAutotagRuntime runtime = new VelocityAutotagRuntime();
    runtime.render(context, writer, node);
    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(context, writer, node, astMap, params);
}