SessionScopeExtractor implements AttributeExtractor { @Override public void removeValue(String name) { HttpSession session = request.getSession(false); if (session != null) { session.removeAttribute(name); } } SessionScopeExtractor(HttpServletRequest request); @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 testRemoveValue() { expect(request.getSession(false)).andReturn(session); session.removeAttribute("name"); replay(request, session); extractor.removeValue("name"); verify(request, session); }