ScopeExtractor implements AttributeExtractor { @Override public Object getValue(String key) { return context.getAttribute(key, 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);  }
@Test public void testGetValue() { expect(context.getAttribute("key", PageContext.PAGE_SCOPE)).andReturn("value"); replay(context); assertEquals("value", extractor.getValue("key")); verify(context); }