System.out.println("----- testFtScan -----");
    public void testFtScan() throws Exception {        String queryBody =            "declare namespace f=\'http://exist-db.org/xquery/test\';\n" +             "declare namespace mods='http://www.loc.gov/mods/v3';\n" +             "import module namespace t=\'http://exist-db.org/xquery/text\';\n" +             "\n" +             "declare function f:term-callback($term as xs:string, $data as xs:int+)\n" +             "as element()+ {\n" +             "    <item>\n" +             "        <term>{$term}</term>\n" +             "        <frequency>{$data[1]}</frequency>\n" +             "    </item>\n" +             "};\n" +             "\n";                XQueryService service = (XQueryService)            testCollection.getService("XQueryService", "1.0");        String query = queryBody + "t:index-terms(collection(\'/db\'), \'is\', util:function(\'f:term-callback\', 2), 1000)";        ResourceSet result = service.query(query);        assertEquals(7, result.getSize());                query = queryBody + "t:index-terms(collection(\'/db\')//LINE, \'is\', util:function(\'f:term-callback\', 2), 1000)";        result = service.query(query);        assertEquals(6, result.getSize());                query = queryBody + "t:index-terms(collection(\'/db\')//mods:title, \'s\', util:function(\'f:term-callback\', 2), 1000)";        result = service.query(query);        assertEquals(20, result.getSize());    }