@Test(expectedExceptions = IllegalArgumentException.class) public void shouldThrowExceptionIfHrefIsRelative() throws Exception { final Link link = new Link(create("service"), "Foo"); linkToJson(link); }
public static Map<String, String> linkToJson(final Link link) { final Map<String, String> json = new LinkedHashMap<>(); json.put("href", link.getHref().toString()); if (!link.getTitle().isEmpty()) { json.put("title", link.getTitle()); } return json; }
LinkConverter { public static Map<String, String> linkToJson(final Link link) { final Map<String, String> json = new LinkedHashMap<>(); json.put("href", link.getHref().toString()); if (!link.getTitle().isEmpty()) { json.put("title", link.getTitle()); } return json; } }
LinkConverter { public static Map<String, String> linkToJson(final Link link) { final Map<String, String> json = new LinkedHashMap<>(); json.put("href", link.getHref().toString()); if (!link.getTitle().isEmpty()) { json.put("title", link.getTitle()); } return json; } private  LinkConverter(); }
LinkConverter { public static Map<String, String> linkToJson(final Link link) { final Map<String, String> json = new LinkedHashMap<>(); json.put("href", link.getHref().toString()); if (!link.getTitle().isEmpty()) { json.put("title", link.getTitle()); } return json; } private  LinkConverter(); static Map<String, String> linkToJson(final Link link); static Link jsonToLink(final Map<String, String> json); static List<Map<String,String>> linksToJson(final Collection<Link> links); static List<Link> jsonToLinks(final Collection<Map<String,String>> json); }
LinkConverter { public static Map<String, String> linkToJson(final Link link) { final Map<String, String> json = new LinkedHashMap<>(); json.put("href", link.getHref().toString()); if (!link.getTitle().isEmpty()) { json.put("title", link.getTitle()); } return json; } private  LinkConverter(); static Map<String, String> linkToJson(final Link link); static Link jsonToLink(final Map<String, String> json); static List<Map<String,String>> linksToJson(final Collection<Link> links); static List<Link> jsonToLinks(final Collection<Map<String,String>> json);  }