public synchronized double progressFraction(BucketId superbucket, BucketId progress) {
        long revBits = bucketToKey(progress.getId());
        int superUsed = superbucket.getUsedBits();
        int progressUsed = progress.getUsedBits();

        if (progressUsed == 0 || progressUsed < superUsed) {
            return 0;
        }

        int splitCount = progressUsed - superUsed;

        if (splitCount == 0) return 1; // Superbucket or inconsistent used-bits

        // Extract reversed split-bits
        revBits <<= superUsed;
        revBits >>>= 64 - splitCount;

        return (double)(revBits + 1) / (double)(1L << splitCount);
    }
@param superbucket The superbucket of which <code>progress</code> is
a sub-bucket
@param progress The sub-bucket for which a fractional progress should
be calculated
@return a value in [0, 1] specifying how far the (sub-bucket) has
reached in its superbucket. This is calculated by looking at the
bucket's split factor.
documentapi/src/main/java/com/yahoo/documentapi/ProgressToken.java