PathUtil filePath = new PathUtil("index.html");
Document document = Document.createFromString(SOURCE);
DocumentParser parser = DocumentParser.create(
document, CodeMirror2.getParser(filePath), new StubIncrementalScheduler(50, 50));
AnchorTagParser anchorParser = new AnchorTagParser(parser);
parser.begin();
JsonArray<AnchorTagParser.AnchorTag> anchorTags = anchorParser.getAnchorTags();
assertEquals(3, anchorTags.size());
assertAnchorTag(anchorTags.get(0), "aName1", 4, 13);
assertAnchorTag(anchorTags.get(1), "aName2", 5, 12);
assertAnchorTag(anchorTags.get(2), "aId1", 6, 11);