@Test
public void testGetKeys() {

    Template template = createMock(Template.class);
    TemplateHashModel model = createMock(TemplateHashModel.class);
    TemplateModel valueModel = createMock(TemplateModel.class);
    Configuration configuration = createMock(Configuration.class);
    Set<String> names = new HashSet<String>();
    names.add("testGetKeys");
    Writer writer = new StringWriter();
    expect(template.getMacros()).andReturn(new HashMap<Object, Object>());
    expect(template.getConfiguration()).andReturn(configuration);
    expect(configuration.getSharedVariableNames()).andReturn(names);
    replay(template, model, valueModel, configuration);
    Environment env = new Environment(template, model, writer);
    EnvironmentScopeExtractor extractor = new EnvironmentScopeExtractor(env);
    Enumeration<String> keys = extractor.getKeys();
    assertEquals("testGetKeys", keys.nextElement());
    assertFalse(keys.hasMoreElements());
    verify(template, model, valueModel, configuration);
}