public Set<LinkDigest> addAllLinks(final Set<LinkDigest> all) {
        for (Block block : mBlocks) {
            all.addAll(block.getDigests());
        }

        if (all.contains(LinkDigest.NULL_DIGEST)) {
            throw new RuntimeException("Assertion Failure: NULL_DIGEST in blocks");
        }

        for (RootObject obj : mRootObjects) {
            if (obj.mDigest.isNullDigest()) {
                continue;
            }
            if (!all.contains(obj.mDigest)) {
                throw new RuntimeException("Assertion Failure: root object not in blocks: " + obj.mDigest);
            }
        }

        return all;
    }