### Question:
GeneratePresignedUrlRequest extends AmazonWebServiceRequest implements SSECustomerKeyProvider, Serializable { public void rejectIllegalArguments() { if (bucketName == null) { throw new IllegalArgumentException( "The bucket name parameter must be specified when generating a pre-signed URL"); } if (this.method == null) { throw new IllegalArgumentException( "The HTTP method request parameter must be specified when generating a pre-signed URL"); } if (this.sseCustomerKey != null) { if (this.sseAlgorithm != null) { throw new IllegalArgumentException("Either SSE or SSE-C can be specified but not both"); } if (this.kmsCmkId != null) { throw new IllegalArgumentException("KMS CMK is not applicable for SSE-C"); } } else if (this.kmsCmkId != null) { if (!SSEAlgorithm.KMS.getAlgorithm().equals(sseAlgorithm)) { throw new IllegalArgumentException( "For KMS server side encryption, the SSE algorithm must be set to " + SSEAlgorithm.KMS); } } } GeneratePresignedUrlRequest(String bucketName, String key);  GeneratePresignedUrlRequest(String bucketName, String key, HttpMethod method); String getKmsCmkId(); void setKmsCmkId(String kmsCmkId); GeneratePresignedUrlRequest withKmsCmkId(String kmsCmkId); String getSSEAlgorithm(); void setSSEAlgorithm(String sseAlgorithm); GeneratePresignedUrlRequest withSSEAlgorithm(String sseAlgorithm); void setSSEAlgorithm(SSEAlgorithm sseAlgorithm); GeneratePresignedUrlRequest withSSEAlgorithm(SSEAlgorithm sseAlgorithm); HttpMethod getMethod(); void setMethod(HttpMethod method); GeneratePresignedUrlRequest withMethod(HttpMethod method); String getBucketName(); void setBucketName(String bucketName); GeneratePresignedUrlRequest withBucketName(String bucketName); String getKey(); void setKey(String key); GeneratePresignedUrlRequest withKey(String key); String getVersionId(); void setVersionId(String versionId); GeneratePresignedUrlRequest withVersionId(String versionId); Date getExpiration(); void setExpiration(Date expiration); GeneratePresignedUrlRequest withExpiration(Date expiration); void addRequestParameter(String key, String value); Map<String, String> getRequestParameters(); Map<String, String> getCustomQueryParameters(); void addCustomQueryParameter(String name, String value); ResponseHeaderOverrides getResponseHeaders(); void setResponseHeaders(ResponseHeaderOverrides responseHeaders); GeneratePresignedUrlRequest withResponseHeaders(ResponseHeaderOverrides responseHeaders); String getContentType(); void setContentType(String contentType); GeneratePresignedUrlRequest withContentType(String contentType); String getContentMd5(); void setContentMd5(String contentMd5); GeneratePresignedUrlRequest withContentMd5(String contentMd5); @Override SSECustomerKey getSSECustomerKey(); void setSSECustomerKey(SSECustomerKey sseCustomerKey); GeneratePresignedUrlRequest withSSECustomerKey(SSECustomerKey sseKey); void setSSECustomerKeyAlgorithm(SSEAlgorithm sseAlgorithm); GeneratePresignedUrlRequest withSSECustomerKeyAlgorithm(SSEAlgorithm algorithm); boolean isZeroByteContent(); void setZeroByteContent(boolean zeroByteContent); GeneratePresignedUrlRequest withZeroByteContent(boolean zeroByteContent); void rejectIllegalArguments();  }### Answer:
@Test public void nullKey() { new GeneratePresignedUrlRequest("bucket", null).rejectIllegalArguments(); }
@Test(expected=IllegalArgumentException.class) public void nullBucket() { new GeneratePresignedUrlRequest(null, "key").rejectIllegalArguments(); }