code: public static List<Link> getAllLinksForRelation(HalResource hal, String relation) {
  
      List<Link> links = Lists.newArrayList(hal.getLinks(relation));
      List<Link> embeddedLinks = hal.getEmbedded().values().stream()
          .flatMap(embedded -> getAllLinksForRelation(embedded, relation).stream())
          .collect(Collectors.toList());
      links.addAll(embeddedLinks);
      return links;
    }
docs: Returns all links in a HAL resource and its embedded resources fitting the supplied relation.
  @param hal HAL resource
  @param relation Link relation
  @return List of all fitting links