public static RollUpBitMask fromShort(final short maskValue) {
        final int maxVal = (int) (Math.pow(2, MASK_LENGTH) - 1);
        final int minVal = 0;

        if (maskValue > maxVal || maskValue < 0) {
            throw new RuntimeException(String.format("Mask value must be between [%s] and [%s]", minVal, maxVal));
        }

        return new RollUpBitMask(maskValue);
    }
@param maskValue The mask represented as a short value between 0 and 32,767. 0
                 represents a mask of all zeros (i.e. every field not rolled
                 up) and 32,767 represents a mask of all 1s (i.e. every field
                 rolled up)
stroom-statistics/stroom-statistics-impl-sql/src/main/java/stroom/statistics/impl/sql/rollup/RollUpBitMask.java