VelocityScopeExtractor implements AttributeExtractor { @Override public Enumeration<String> getKeys() { return new KeyEnumeration(context.getKeys()); } VelocityScopeExtractor(Context context); @Override void removeValue(String name); @Override Enumeration<String> getKeys(); @Override Object getValue(String key); @Override void setValue(String key, Object value);  }
@Test public void testGetKeys() { expect(request.getKeys()).andReturn(new Object[] {"one", "two"}); replay(request); Enumeration<String> keys = extractor.getKeys(); assertTrue(keys.hasMoreElements()); assertEquals("one", keys.nextElement()); assertTrue(keys.hasMoreElements()); assertEquals("two", keys.nextElement()); assertFalse(keys.hasMoreElements()); verify(request); }