ScopeExtractor implements AttributeExtractor { @Override public Enumeration<String> getKeys() { return context.getAttributeNamesInScope(scope); } ScopeExtractor(JspContext context, int scope); @Override void removeValue(String name); @Override Enumeration<String> getKeys(); @Override Object getValue(String key); @Override void setValue(String key, Object value);  }
@SuppressWarnings("unchecked") @Test public void testGetKeys() { Enumeration<String> keys = createMock(Enumeration.class); expect(context.getAttributeNamesInScope(PageContext.PAGE_SCOPE)).andReturn(keys); replay(context); assertEquals(keys, extractor.getKeys()); verify(context); }