@SuppressWarnings("unchecked")
    private <T> T fillInResponseMetadata(AmazonWebServiceResponse<T> awsResponse,
                                         HttpResponse httpResponse) {
        final T result = awsResponse.getResult();
        if (result instanceof AmazonWebServiceResult<?>) {
            ((AmazonWebServiceResult) result)
                    .setSdkResponseMetadata(awsResponse.getResponseMetadata())
                    .setSdkHttpMetadata(SdkHttpMetadata.from(httpResponse));
        }
        return result;
    }
@param delegate          Response handler to delegate to and unwrap
@param request           Marshalled request
@param awsRequestMetrics Request metrics
aws-java-sdk-core/src/main/java/com/amazonaws/http/response/AwsResponseHandlerAdapter.java