code: public static Integer bitMask(List<Integer> param) {
          if (param != null && param.size() > 0) {
              int result = 0;
              for (Integer i : param) {
                  result |= 1 << i;
              }
              return result;
          } else {
              return null;
          }
      }
docs: Converts {@link List} of enum values to a bit mask.
  Enum values from 0 to 31 inclusive are supported, since {@link Integer} has only 32 bits.