private String getDescriptionFromLinkTitle(Map<String, List<Link>> links, String rel) { List<Link> linksForRel = links.get(rel); if (linksForRel != null) { for (Link link : linksForRel) { if (link.getTitle() != null) { return link.getTitle(); } } } throw new SnippetException("No description was provided for the link with rel '" + rel + "' and no title was available from the link in the payload"); }