@Test
    public void testExceptionOnWrongDocumentSelection() throws ParseException {
        BucketIdFactory idFactory = new BucketIdFactory();
        // Since we don't store the actual original document selection in the
        // progress files, we can't really tell whether or not a "wrong" document
        // selection has been given, so we just do a best effort by checking
        // that the number of total buckets match up and that the bucket cursor
        // isn't set for explicit sources

        // Try to pass a known document selection to an unknown docsel iterator
        boolean caughtIt = false;
        try {
            ProgressToken p = new ProgressToken("""
                    VDS bucket progress file
                    16
                    3
                    1
                    3
                    8000000000001f49:0
                    8000000000001a85:0
                    """);

            VisitorIterator.createFromDocumentSelection("id.group != \"yahoo.com\"", idFactory, 16, p);
        }
        catch (IllegalArgumentException e) {
            caughtIt = true;
        }
        assertTrue(caughtIt);

        // Now try it the other way around
        caughtIt = false;
        try {
            ProgressToken p = new ProgressToken("""
                    VDS bucket progress file
                    10
                    503
                    500
                    1024
                    28000000000000be:0
                    28000000000002be:0
                    28000000000001be:0
                    """);

            VisitorIterator.createFromDocumentSelection("id.group=\"yahoo.com\" or id.user=555", idFactory, 16, p);
        }
        catch (IllegalArgumentException e) {
            caughtIt = true;
        }
        assertTrue(caughtIt);
    }
Test increasing the distribution bits for a full bucket space range
source with no finished, active or pending buckets
@throws ParseException upon docsel parse failure (shouldn't happen)
documentapi/src/test/java/com/yahoo/documentapi/VisitorIteratorTestCase.java