return new HalLinkList(halResource, link.relation(),
(Class) getCollectionType(method.getGenericReturnType(), 0, ResourceInfo.class),
halClient);
} else if (Map.class.isAssignableFrom(method.getReturnType())) {
//noinspection unchecked
return new HalLinkMap(halResource, link.relation(), link.keyField(),
(Class) getCollectionType(method.getGenericReturnType(), 1, ResourceInfo.class),
halClient);
} else {
return halClient.getResource(halResource, method.getReturnType(),
getRelationHref(link, args == null ? EMPTY_ARGS : args, method.getParameterAnnotations()), false);