code: public static <T extends Enum<T> & SaneEnum> Set<T> enumSet(Class<T> enumType, int wireValue) {
      T[] enumConstants = enumType.getEnumConstants();
      List<T> values = Lists.newArrayListWithCapacity(enumConstants.length);
  
      for (T value : enumConstants) {
        if ((wireValue & value.getWireValue()) != 0) {
          values.add(value);
        }
      }
  
      return Sets.immutableEnumSet(values);
    }
docs: Returns a set of {@code T} obtained by treating {@code wireValue} as a bit vector whose bits
  represent the wire values of the enum constants of the given {@code enumType}.