private static void addInstanceService(Method m, Object entity,
UriInfo uriInfo, RESTServiceDiscovery ret, LinkResource service,
String rel) {
UriBuilder uriBuilder = uriInfo.getBaseUriBuilder().path(m.getDeclaringClass());
if(m.isAnnotationPresent(Path.class))
uriBuilder.path(m);
URI uri = buildURI(uriBuilder, service, entity, m);
if (rel.length() == 0) {
if (m.isAnnotationPresent(GET.class)){
Class<?> type = m.getReturnType();