@Test
    public void testRangeDistributionBitIncrease1AllBucketStates() throws ParseException {
        int db = 3;
        BucketIdFactory idFactory = new BucketIdFactory();
        ProgressToken p = new ProgressToken();

        VisitorIterator iter = VisitorIterator.createFromDocumentSelection(
                "id.group != \"yahoo.com\"", idFactory, db, p);

        // For this test, have 1 finished bucket, 3 pending and 0 active (we
        // want to have the splitting to be triggered immediately)
        VisitorIterator.BucketProgress bp = iter.getNext();
        iter.update(bp.getSuperbucket(), ProgressToken.FINISHED_BUCKET);
        VisitorIterator.BucketProgress[] bpp = new VisitorIterator.BucketProgress[3];
        bpp[0] = iter.getNext();
        bpp[1] = iter.getNext();
        bpp[2] = iter.getNext();
        iter.update(bpp[0].getSuperbucket(), new BucketId());
        iter.update(bpp[1].getSuperbucket(), new BucketId());
        iter.update(bpp[2].getSuperbucket(), new BucketId());

        assertEquals(p.getFinishedBucketCount(), 1);
        assertEquals(p.getPendingBucketCount(), 3);
        assertEquals(p.getActiveBucketCount(), 0);

        iter.setDistributionBitCount(db + 1);

        assertEquals(p.getTotalBucketCount(), 16);
        assertEquals(p.getFinishedBucketCount(), 2);
        assertEquals(p.getPendingBucketCount(), 6);
        assertEquals(p.getActiveBucketCount(), 0);
        assertEquals(p.getDistributionBitCount(), db + 1);
        assertEquals(iter.getDistributionBitCount(), db + 1);
        assertEquals(iter.getBucketSource().getDistributionBitCount(), db + 1);

        // Bucket 3:0x4 -> 4:0x4 & 4:0xC
        assertEquals(iter.getNext().getSuperbucket(), new BucketId(db + 1, 0x04));
        assertEquals(iter.getNext().getSuperbucket(), new BucketId(db + 1, 0x0C));
        // Bucket 3:0x2 -> 4:0x2 & 4:0xA
        assertEquals(iter.getNext().getSuperbucket(), new BucketId(db + 1, 0x02));
        assertEquals(iter.getNext().getSuperbucket(), new BucketId(db + 1, 0x0A));
        // Bucket 3:0x6 -> 4:0x6 & 4:0xE
        assertEquals(iter.getNext().getSuperbucket(), new BucketId(db + 1, 0x06));
        assertEquals(iter.getNext().getSuperbucket(), new BucketId(db + 1, 0x0E));

        assertEquals(p.getPendingBucketCount(), 0);
        // Bucket source should now begin returning from bucket 4:0x1
        assertEquals(iter.getNext().getSuperbucket(), new BucketId(db + 1, 0x01));
        assertEquals(iter.getNext().getSuperbucket(), new BucketId(db + 1, 0x09));
        assertEquals(iter.getNext().getSuperbucket(), new BucketId(db + 1, 0x05));
        assertEquals(iter.getNext().getSuperbucket(), new BucketId(db + 1, 0x0D));
        assertEquals(iter.getNext().getSuperbucket(), new BucketId(db + 1, 0x03));
        // Assume correct from here on
    }
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