Turn the bellow mess into a proper, composable object. Each of those objects should be easily tested, replaceable and no setter should have to be called.
Context: It is an HTTP request made to one of AWS' webservices, which needs to be signed with the blood of 4 goats struck by lightning, on a fullmoon night. Bellow is the aws-java-sdk-core v1.
//Instantiate the request Request<Void> request = new DefaultRequest<Void>("es"); //?!? request.setHttpMethod(HttpMethodName.GET); request.setEndpoint(URI.create("http://..."));