@Test
    public void testIsBucketFinished() throws ParseException {
        BucketIdFactory idFactory = new BucketIdFactory();
        ProgressToken p = new ProgressToken();
        VisitorIterator iter = VisitorIterator.createFromDocumentSelection(
                "id.group != \"yahoo.com\"", idFactory, 4, p);

        assertFalse(p.isBucketFinished(new BucketId(32, 0)));
        // Finish superbucket 0x0000
        iter.update(iter.getNext().getSuperbucket(), ProgressToken.FINISHED_BUCKET);
        assertTrue(p.isBucketFinished(new BucketId(32, 0)));
        // Cursor is 1, but bucket 0x1000 not yet returned
        assertFalse(p.isBucketFinished(new BucketId(32, 1 << 3)));
        VisitorIterator.BucketProgress bp = iter.getNext();
        // Cursor 2, 0x1000 returned but is contained in state, so not finished
        assertFalse(p.isBucketFinished(new BucketId(32, 1 << 3)));
        iter.update(bp.getSuperbucket(), ProgressToken.FINISHED_BUCKET);
        assertTrue(p.isBucketFinished(new BucketId(32, 1 << 3)));
        // Only superbucket part is used
        assertTrue(p.isBucketFinished(new BucketId(32, 0x12345670)));  // ...0000
        assertTrue(p.isBucketFinished(new BucketId(32, 0x12345678)));  // ...1000
        assertFalse(p.isBucketFinished(new BucketId(32, 0x12345671))); // ...0001
        assertFalse(p.isBucketFinished(new BucketId(32, 0x12345679))); // ...1001
    }
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