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

        // Create a range of [0, 4) superbuckets
        VisitorIterator iter = VisitorIterator.createFromDocumentSelection(
                "id.group != \"yahoo.com\"", idFactory, db, p);

        VisitorIterator.BucketProgress bp = iter.getNext();
        // Put back as pending and split it
        iter.update(bp.getSuperbucket(), new BucketId());
        p.splitPendingBucket(new BucketId(db, 0));
        assertEquals(p.getPendingBucketCount(), 2);
        // Merge both back into one node. Merge from left sibling with right present
        p.mergePendingBucket(new BucketId(db + 1, 0));
        assertEquals(p.getPendingBucketCount(), 1);
        bp = iter.getNext();
        assertEquals(bp.getSuperbucket(), new BucketId(db, 0));
    }
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