ParametersServletRequestWrapper extends HttpServletRequestWrapper { @Override public Enumeration<String> getParameterNames() { return Collections.enumeration(parameters.keySet()); } ParametersServletRequestWrapper(HttpServletRequest httpServletRequest); @Override String getParameter(String name); @Override Map<String, String[]> getParameterMap(); @Override Enumeration<String> getParameterNames(); @Override String[] getParameterValues(String name); void addParameter(String name, String value); @Override void setCharacterEncoding(String enc);  }
@Test public void getParameterNamesIsNotDelegated() throws Exception { HttpServletRequest request = createMock(HttpServletRequest.class); ParametersServletRequestWrapper wrapper = new ParametersServletRequestWrapper(request); replay(request); Enumeration names = wrapper.getParameterNames(); verify(request); assertNotNull(names); assertFalse(names.hasMoreElements()); }