public static int enumSetToValuesMask(@Nullable final Set<RxBlePhyImpl> set) {
        if (set == null || set.size() == 0) {
            return RxBlePhyImpl.PHY_1M.getMask();
        }

        final Iterator<RxBlePhyImpl> iterator = set.iterator();

        int result = 0;

        while (iterator.hasNext()) {
            final int requestedValue = iterator.next().getMask();
            result |= requestedValue;
        }

        return result;
    }
Function used to convert the specified enum set to the equivalent values mask.

@param set The enum set to compute the values mask for.

@return If the set is NULL, empty, then the default value mask, RxBlePhy.PHY_1M, is returned.
Otherwise, the resulting values mask is returned.
rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/RxBlePhyImpl.java