@Test
public void testPreparePreviouslyWappedRequestButRewrappedOnTop() {

  HttpRequestWrapper request = mock(HttpRequestWrapper.class);
  ServletResponse response = mock(HttpServletResponse.class);
  ServletContext originalServletContext = mock(ServletContext.class);
  when(request.getServletContext()).thenReturn(originalServletContext);
  ServletRequest reWrappedRequest = mock(HttpServletRequest.class);
  ServletContext another = mock(ServletContext.class);
  when(another.getAttribute(SessionHelpers.SESSION_HELPERS)).thenReturn(new SessionHelpers());
  when(reWrappedRequest.getServletContext()).thenReturn(another);
  when(reWrappedRequest.getAttribute(SessionHelpers.REQUEST_WRAPPED_ATTRIBUTE)).thenReturn(request);
  ServletRequest result = SessionHelpersFacade.prepareRequest(reWrappedRequest, response, originalServletContext);
  assertNotNull(result);
  assertNotSame(request, result);
  assertSame(reWrappedRequest, result);
}