public void testDynamicImports() {
    ParserContext ctx = new ParserContext();
    ctx.addPackageImport("java.util");

    ExpressionCompiler compiler = new ExpressionCompiler("HashMap", ctx);
    Serializable s = compiler.compile();

    assertEquals(HashMap.class,
        executeExpression(s));

    compiler = new ExpressionCompiler("map = new HashMap(); map.size()", ctx);
    s = compiler.compile();

    assertEquals(0,
        executeExpression(s,
            new DefaultLocalVariableResolverFactory()));
  }