public static RollUpBitMask fromMask(final short[] mask) {
        if (mask.length > MASK_LENGTH) {
            throw new RuntimeException("Array is too long");
        }

        short tempMask = 0;

        final int len = mask.length;

        for (short i = 0; i < len; i++) {
            if (mask[i] == 1) {
                tempMask = setMaskValueAtPosition(i, tempMask);
            } else if (mask[i] != 0) {
                throw new RuntimeException(String.format("Value at mask position %s is not one of 1 or 0", mask[i]));
            }
        }
        return new RollUpBitMask(tempMask);
    }
@param mask An array of length MASK_LENGTH containing values 0 or 1. A
            value of 1 at a position indicates that the tag at that
            position in the row key should have its values rolled up
@return
stroom-statistics/stroom-statistics-impl-hbase/src/main/java/stroom/statistics/impl/hbase/rollup/RollUpBitMask.java