assertEquals("b", ((FieldQuery) i.next()).getFieldName()); assertEquals("b", ((FieldQuery) i.next()).getFieldName()); assertFalse(i.hasNext());
    public void testGetFields() throws Exception {        IngridQuery query = QueryStringParser.parse("(t:f OR t:4) OR (b:a OR b:a OR (b:c) OR ((a:i) AND (wasser))))");                Vector v = tools.getFieldsAsVector(query, false, true);        Iterator i = v.iterator();        assertEquals("t", ((FieldQuery) i.next()).getFieldName());        assertEquals("b", ((FieldQuery) i.next()).getFieldName());                     v = tools.getFieldsAsVector(query, false, true);        i = v.iterator();        assertEquals("t", ((FieldQuery) i.next()).getFieldName());        assertEquals("b", ((FieldQuery) i.next()).getFieldName());        assertEquals("a", ((FieldQuery) i.next()).getFieldName());        assertEquals("b", ((FieldQuery) i.next()).getFieldName());                query = QueryStringParser.parse("(t:f OR t:4) OR (b:a OR b:a OR (b:c) NOT ((a:i) AND (wasser))))");        v = tools.getFieldsAsVector(query, false, false);        i = v.iterator();        assertEquals("t", ((FieldQuery) i.next()).getFieldName());        assertEquals("b", ((FieldQuery) i.next()).getFieldName());    }