code: private <T extends HalRepresentation> T getResource(final Link link,
                                                          final Class<T> type,
                                                          final List<EmbeddedTypeInfo> embeddedType) throws IOException {
          LOG.trace("Fetching resource href={} rel={} as type={} with embeddedType={}", link.getHref(), link.getRel(), type.getSimpleName(), embeddedType);
          final String json;
          try {
              json = linkResolver.apply(link);
              LOG.trace("Got {}", json);
          } catch (final IOException | RuntimeException e) {
              LOG.error("Failed to fetch resource href={}: {}", link.getHref(), e.getMessage());
              throw e;
          }
          try {
              return embeddedType != null && !embeddedType.isEmpty()
                      ? parse(json, objectMapper).as(type, embeddedType)
                      : parse(json, objectMapper).as(type);
          } catch (final RuntimeException e) {
              LOG.error("Failed to parse resource href={} rel={} as type={} with embeddedType={}", link.getHref(), link.getRel(), type.getSimpleName(), embeddedType);
              throw e;
          }
      }
docs: Retrieve the HAL resource identified by {@code uri} and return the representation as a HalRepresentation.
  
  @param link the Link of the resource to retrieve, or null, if the contextUrl should be resolved.
  @param type the expected type of the returned resource
  @param embeddedType type information to specify the type of embedded resources.
  @param <T> the type of the returned HalRepresentation
  @return HalRepresentation
  @throws IllegalArgumentException if resolving URLs is failing
  @throws IOException if a low-level I/O problem (unexpected end-of-input, network error) occurs.
  @throws JsonParseException if the json document can not be parsed by Jackson's ObjectMapper
  @throws JsonMappingException if the input JSON structure can not be mapped to the specified HalRepresentation type