}
@GET
@Produces("application/atom+xml")
public String getAtom(@Context LinkBuilders builders) {
SystemLinksBuilder builder = builders.createSystemLinksBuilder();
List<SyndLink> links = new ArrayList<SyndLink>();
builder.types(LinkType.ALTERNATE).build(links);
assertEquals(3, links.size());
assertLink(links,
"alternate",
"application/xml",
"systemLinksSelective?alt=application%2Fxml");
assertLink(links,
"alternate",
"application/json",
"systemLinksSelective?alt=application%2Fjson");
assertLink(links,
"alternate",
"application/atom+xml",
"systemLinksSelective?alt=application%2Fatom%2Bxml");
links.clear();
builder.types(LinkType.SELF).build(links);
assertEquals(1, links.size());
assertLink(links, "self", null, "systemLinksSelective");
links.clear();
builder.types(LinkType.EDIT).build(links);
assertEquals(1, links.size());
assertLink(links, "edit", null, "systemLinksSelective");
links.clear();
builder.types(LinkType.OPENSEARCH).build(links);
assertEquals(1, links.size());
assertLink(links,
"search",
"application/opensearchdescription+xml",
"systemLinksSelective?alt=application%2Fopensearchdescription%2Bxml");
links.clear();
builder.types(LinkType.SELF, LinkType.EDIT).build(links);
assertEquals(2, links.size());
assertLink(links, "self", null, "systemLinksSelective");
assertLink(links, "edit", null, "systemLinksSelective");
links.clear();
builder.types(LinkType.EDIT, LinkType.OPENSEARCH).build(links);
assertEquals(2, links.size());
assertLink(links, "edit", null, "systemLinksSelective");
assertLink(links,
"search",
"application/opensearchdescription+xml",
"systemLinksSelective?alt=application%2Fopensearchdescription%2Bxml");
links.clear();
builder.types(LinkType.SELF, LinkType.EDIT, LinkType.OPENSEARCH, LinkType.ALTERNATE)
.build(links);
assertEquals(6, links.size());
assertLink(links, "self", null, "systemLinksSelective");
assertLink(links, "edit", null, "systemLinksSelective");
assertLink(links,
"search",
"application/opensearchdescription+xml",
"systemLinksSelective?alt=application%2Fopensearchdescription%2Bxml");
assertLink(links,
"alternate",
"application/xml",
"systemLinksSelective?alt=application%2Fxml");
assertLink(links,
"alternate",
"application/json",
"systemLinksSelective?alt=application%2Fjson");
assertLink(links,
"alternate",
"application/atom+xml",
"systemLinksSelective?alt=application%2Fatom%2Bxml");
links.clear();
builder.types().build(links);
assertEquals(6, links.size());
assertLink(links, "self", null, "systemLinksSelective");
assertLink(links, "edit", null, "systemLinksSelective");
assertLink(links,
"alternate",