ResourceLinkGenerator { protected URI relationTypeFrom(final Method method) { final Rel controllerRel = findAnnotation(method.getDeclaringClass(), Rel.class); final Rel methodRel = findAnnotation(method, Rel.class); if (controllerRel == null && methodRel == null) { return null; } else { final String linkRelationType = methodRel != null ? methodRel.value() : controllerRel.value(); if (linkRelationType.startsWith("http: return create(linkRelationType); } else { return normalized(relationTypeBaseUri).withPathSegment(linkRelationType).toUri(); } } } protected  ResourceLinkGenerator(final URI applicationBaseUri,
                                    final URI relationTypeBaseUri,
                                    final URI varTypeBaseUri,
                                    final HintsGenerator hintsGenerator,
                                    final HrefVarsGenerator hrefVarsGenerator); ResourceLink resourceLinkFor(final Method method);  }
@Test public void testRelationTypeFrom() throws Exception { ResourceLinkGenerator generator = new TestResourceLinkGenerator(); final URI rel = generator.relationTypeFrom(TestController.class.getMethod("directLink")); assertEquals(rel, URI.create(RELATION_TYPE_BASE_URI + "/rel/test")); }