@Test
public void testFilter() throws ParseException {

    final String LINK = "</test/1>;rt=\"dummy-rt\","
            + "</test/2>;rt=\"dummy-rt dummy-rt2\";obs;media=text/plain,"
            + "</test/3>;rt=\"dummy-rt3\";obs";
    List<LinkFormat> list = LinkFormatBuilder.parseLinkAsList(LINK);
    List<LinkFormat> links = LinkFormatBuilder.filter(list, DataConvertingUtility.parseUriQuery("rt=dummy-rt3"));
    assertNotNull(links);
    assertEquals(1, links.size());
    assertEquals("/test/3", links.get(0).getUri());
    links = LinkFormatBuilder.filter(list, DataConvertingUtility.parseUriQuery("rt=dummy-rt"));
    assertNotNull(links);
    assertEquals(2, links.size());
    assertEquals("/test/1", links.get(0).getUri());
    assertEquals("/test/2", links.get(1).getUri());
    links = LinkFormatBuilder.filter(list, DataConvertingUtility.parseUriQuery("rt=dummy-rt3&obs=true"));
    assertNotNull(links);
    assertEquals(1, links.size());
    assertEquals("/test/3", links.get(0).getUri());
    links = LinkFormatBuilder.filter(list, DataConvertingUtility.parseUriQuery("media=text/plain"));
    assertNotNull(links);
    assertEquals(1, links.size());
    assertEquals("/test/2", links.get(0).getUri());
    links = LinkFormatBuilder.filter(list, DataConvertingUtility.parseUriQuery("rt=dummy-rt3&media=text/plain"));
    assertNotNull(links);
    assertEquals(0, links.size());
}