### Question:
AWS4Signer extends AbstractAWSSigner implements ServiceAwareSigner, RegionAwareSigner, Presigner { boolean needsSign(String header) { return "date".equalsIgnoreCase(header) || "Content-MD5".equalsIgnoreCase(header) || "host".equalsIgnoreCase(header) || header.startsWith("x-amz") || header.startsWith("X-Amz"); } AWS4Signer();  AWS4Signer(boolean doubleUrlEncoding); @Override void sign(Request<?> request, AWSCredentials credentials); @Override void setServiceName(String serviceName); @Override void setRegionName(String regionName); @Override void presignRequest(Request<?> request, AWSCredentials credentials,
            Date expiration);  }### Answer:
@Test public void testCorrectHeadersAreSigned() { assertTrue(signer.needsSign("date")); assertTrue(signer.needsSign("Content-MD5")); assertTrue(signer.needsSign("x-amz")); assertTrue(signer.needsSign("X-Amz")); assertTrue(signer.needsSign("host")); assertFalse(signer.needsSign("")); assertFalse(signer.needsSign("Content-Type")); assertFalse(signer.needsSign("Content-Length")); assertFalse(signer.needsSign("Signature")); assertFalse(signer.needsSign("Accept-Encoding")); assertFalse(signer.needsSign("Accept")); assertFalse(signer.needsSign("User-Agent")); }