@Test public void testFigure() throws UIMAException { final JCas jCas = JCasSingleton.getJCasInstance(); final StructuralAnnotations sa = new StructuralAnnotations(); final Element anchor = new Element(Tag.valueOf("img"), ""); anchor.attr("src", "test"); final AnnotationCollector collector = new AnnotationCollector(); sa.map(jCas, anchor, collector); Annotation fig = collector.getAnnotations().get(0); assertTrue(fig instanceof Figure); assertEquals("test", ((Figure) fig).getTarget()); }