private <T> Response<T> toResponse(Timer timer, javax.ws.rs.core.Response cxfResponse, Request<T> request) {
InputStream inputStream = (InputStream) cxfResponse.getEntity();
Response<T> response = null;
HttpStatus status = HttpStatus.getStatus(cxfResponse.getStatus());
response = deserialize(inputStream, request);
response.setStatusCode(status.getCode());
response.setResponseTime(timer.getDifference());
return response;
}