    @Test
    public void testPriority() throws IOException, SAXException {

        String s = "the quick brown fox as well as some other fox and quick";

        SpanQuery spanQuery = new SpanOrQuery(foxQuick, foxAs);
        Analyzer analyzer = new WhitespaceAnalyzer();
        ContentHandler handler = new ToHTMLContentHandler();
        RhapsodeXHTMLHandler xhtml = new RhapsodeXHTMLHandler(handler);
        RhapsodeXHTMLHandler.simpleInit(xhtml);

        Set<HighlightingQuery> highlightingQueries = new HashSet<>();
        highlightingQueries.add(new HighlightingQuery(spanQuery, 2, "this-the-one"));
        highlightingQueries.add(new HighlightingQuery(new SpanTermQuery(new Term(field, "fox")), 1, "this-the-two"));
        DocHighlighter h = new DocHighlighter();
        h.highlightSingleFieldValue(field, s, highlightingQueries, analyzer, new AtomicBoolean(false), xhtml);
        xhtml.endElement(H.BODY);
        xhtml.endDocument();
        assertTrue(handler.toString().contains("brown <span id=\"first\" class=\"this-the-two\">fox</span>"));
        assertTrue(handler.toString().contains(" other <span class=\"this-the-two\">fox</span>"));

        //TODO: for now, the longer and earlier of a matching span is used.
        //We'd probably want to have a "joint" span of "quick brown fox as"
    }