@Test
    public void testDeserializedFinishedProgress() {
        StringBuilder finished = new StringBuilder();
        finished.append("VDS bucket progress file\n"); // legacy; no completion percentage
        finished.append(17);
        finished.append('\n');
        finished.append(1L << 17); // Cursor
        finished.append('\n');
        finished.append(1L << 17); // Finished
        finished.append('\n');
        finished.append(1L << 17); // Total
        finished.append('\n');

        ProgressToken token = new ProgressToken(finished.toString());
        assertEquals(token.getDistributionBitCount(), 17);
        assertEquals(token.getTotalBucketCount(), 1L << 17);
        assertEquals(token.getFinishedBucketCount(), 1L << 17);
        assertEquals(token.getBucketCursor(), 1L << 17);
        assertTrue(token.isFinished());

        ProgressToken token2 = new ProgressToken(token.serialize());
        assertEquals(17, token2.getDistributionBitCount());
        assertEquals(1L << 17, token2.getTotalBucketCount());
        assertEquals(1L << 17, token2.getFinishedBucketCount());
        assertEquals(1L << 17, token2.getBucketCursor());
        assertTrue(token2.isFinished());
    }
Test that ensures doing update(superbucket, 0) simply puts the bucket back in
pending
documentapi/src/test/java/com/yahoo/documentapi/VisitorIteratorTestCase.java