void () { ColorSettingsPage page = new XMLColorsPage(); Map<String, TextAttributesKey> map = page.getAdditionalHighlightingTagToDescriptorMap(); List<HighlightData> highlights = new ArrayList<>(); String s = new HighlightsExtractor(map, INLINE_ELEMENT_DESCRIPTORS, COLOR_KEY_MAPPING).extractHighlights(page.getDemoText(), highlights); assertEquals(10, highlights.size()); assertEquals(""" <?xml version='1.0' encoding='ISO-8859-1' ?> <!DOCTYPE index> <!-- Some xml example --> <index version="1.0" xmlns:pf="http://test"> <name>Main Index</name> <indexitem text="rename" target="refactoring.rename"/> <indexitem text="move" target="refactoring.move"/> <indexitem text="migrate" target="refactoring.migrate"/> <indexitem text="usage search" target="find.findUsages"/> <indexitem>Matched tag name</indexitem> <someTextWithEntityRefs>&amp; &#x00B7;</someTextWithEntityRefs> <withCData><![CDATA[ <object class="MyClass" key="constant"> </object> ]]> </withCData> <indexitem text="project" target="project.management"/> <custom-tag>hello</custom-tag> <pf:foo pf:bar="bar"/> </index>""", s); }