### Question:
RequestSignature implements HttpRequestInterceptor { @Override public void process(HttpRequest request, HttpContext context) throws HttpException, IOException { try { this.messageSigner.sign(new Request(request)); } catch (GeneralSecurityException e) { throw new HttpException("Can't sign HTTP request '" + request + "'", e); } } RequestSignature(HttpMessageSigner messageSigner); @Override void process(HttpRequest request, HttpContext context);  }### Answer:
@Test public void testInterceptor() throws GeneralSecurityException, HttpException, IOException { HttpMessageSigner httpSignature = HttpMessageSigner.builder() .algorithm(Algorithm.RSA_SHA256) .keyMap(HashKeyMap.INSTANCE) .addHeaderToSign(HttpMessageSigner.REQUEST_TARGET) .addHeaderToSign("Date") .addHeaderToSign("Content-Length") .addHeaderToSign("Digest") .keyId("myKeyId").build(); HttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("GET", "http: request.setEntity(new StringEntity("Hello World!")); createHttpProcessor(httpSignature).process(request, new BasicHttpContext()); SignatureHeaderVerifier signatureVerifier = SignatureHeaderVerifier.builder().keyMap(HashKeyMap.INSTANCE).build(); assertTrue(signatureVerifier.verify(new Request(request))); }