code: public static Link getLinkByRel(Entity entity, String... rel) {
          if(entity == null) {
              throw new IllegalArgumentException("entity cannot be null.");
          }
          if(ArrayUtils.isEmpty(rel)) {
              throw new IllegalArgumentException("rel cannot be null or empty");
          }
          List<Link> links = entity.getLinks();
          if (links == null)
              return null;
          Link link = null;
          for (Link l : links) {
              if (ArrayUtils.isNotEmpty(l.getRel()) && ArrayUtils.toString(rel).equals(ArrayUtils.toString(l.getRel()))) {
                  link = l;
                  break;
              }
          }
          return link;
      }
docs: Retrieve a link by its relationship.
  @param entity cannot be <code>null</code>.
  @param rel cannot be <code>null</code> or empty.
  @return the located link or <code>null</code> if not found.