code: public static <E extends Enum<E>> Collector<E, ?, EnumSet<E>> toEnumSet(Class<E> enumClass) {
      return Collectors.toCollection(() -> EnumSet.noneOf(enumClass));
    }
docs: A Collector into an {@link EnumSet} of specified enumeration.