ApplicationScopeExtractor implements AttributeExtractor { @Override public Object getValue(String key) { return context.getAttribute(key); } ApplicationScopeExtractor(ServletContext context); @Override void setValue(String name, Object value); @Override void removeValue(String name); @SuppressWarnings("unchecked") @Override Enumeration<String> getKeys(); @Override Object getValue(String key);  }
@Test public void testGetValue() { expect(context.getAttribute("attribute")).andReturn("value"); replay(context); assertEquals("value", extractor.getValue("attribute")); verify(context); }