### Question:
XWikiRequestCopier implements Copier<XWikiRequest> { @Override public XWikiRequest copy(XWikiRequest originalRequest) throws CloneFailedException { if (originalRequest == null) { return null; } XWikiServletRequestStub dummyRequest = new XWikiServletRequestStub(originalRequest); return new XWikiServletRequest(dummyRequest); }  @Override XWikiRequest copy(XWikiRequest originalRequest);  }### Answer:
@Test void copyRequest() { XWikiRequest copy = this.copier.copy(this.originalRequest); assertNotSame(this.originalRequest, copy); assertEquals(this.originalRequest.getHeader("x-forwarded-host"), copy.getHeader("x-forwarded-host")); assertEquals(this.originalRequest.getContextPath(), copy.getContextPath()); assertEquals(this.originalRequest.getScheme(), copy.getScheme()); assertEquals(this.originalRequest.getAttributeNames(), copy.getAttributeNames()); assertEquals(this.originalRequest.getAttribute("attribute"), copy.getAttribute("attribute")); assertEquals(this.originalRequest.getServerName(), copy.getServerName()); assertNotSame(this.originalRequest.getRequestURL(), copy.getRequestURL()); assertEquals(this.originalRequest.getRequestURL().toString(), copy.getRequestURL().toString()); }
@Test void copyContextWhenNull() { assertNull(this.copier.copy(null)); }