Object entity = response.getEntity();
if (entity != null) {
Class<?> entityClass = entity.getClass();
LinkProcessor lhp = new LinkProcessor(entityClass);
lhp.processLinkHeaders(entity, uriInfo, response.getHttpHeaders());
RefProcessor lp = new RefProcessor(entityClass);
lp.processLinks(entity, uriInfo);
}
return response;
}