SelectorFactory { public static ResourceObject getMediaFragmentsSpecification(Anno4j anno4j) throws RepositoryException, IllegalAccessException, InstantiationException { return anno4j.createObject(ResourceObject.class, (Resource) new URIImpl(FragmentSpecification.W3C_MEDIA_FRAGMENTS.toString())); }  static ResourceObject getHtmlXhtmlSpecification(Anno4j anno4j); static ResourceObject getPdfSpecification(Anno4j anno4j); static ResourceObject getPlainTextSpecification(Anno4j anno4j); static ResourceObject getXmlSpecification(Anno4j anno4j); static ResourceObject getRdfXmlSpecification(Anno4j anno4j); static ResourceObject getMediaFragmentsSpecification(Anno4j anno4j); static ResourceObject getSvgSpecification(Anno4j anno4j);  }
@Test public void testMultipleSelectors() throws RepositoryException, IllegalAccessException, InstantiationException, ParseException, MalformedQueryException, QueryEvaluationException { ResourceObject fragmentSpec = SelectorFactory.getMediaFragmentsSpecification(this.anno4j); List<ResourceObject> result = this.anno4j.findAll(ResourceObject.class); assertEquals(3, result.size()); ResourceObject fragmentSpec2 = SelectorFactory.getMediaFragmentsSpecification(this.anno4j); assertEquals(3, result.size()); QueryService qs = this.anno4j.createQueryService(); qs.addCriteria(".", FragmentSpecification.W3C_MEDIA_FRAGMENTS.toString()); List<ResourceObject> result2 = qs.execute(ResourceObject.class); assertEquals(1, result2.size()); }