}
@Test
public void testGetLink() {
InboundMessageContext r = createInboundMessageContext();
Link link1 = Link.fromUri("http://example.org/app/link1").param("produces", "application/json").param("method",
"GET").rel("self").build();
Link link2 = Link.fromUri("http://example.org/app/link2").param("produces", "application/xml").param("method",
"PUT").rel("update").build();
Link link3 = Link.fromUri("http://example.org/app/link2").param("produces", "application/xml").param("method",
"POST").rel("update").build();
r.header("Link", link1.toString());
r.header("Link", link2.toString());
r.header("Link", link3.toString());
assertTrue(r.getLink("self").equals(link1));
assertTrue(r.getLink("update").equals(link2) || r.getLink("update").equals(link3));
}