public static <T extends Enum<T>> Set<T> enumSetOf(final Class<T> type, final T... items) {
        final EnumSet<T> enumSet = EnumSet.noneOf(type);
        if (items != null) {
            for (final T item : items) {
                if (item != null) {
                    enumSet.add(item);
                }
            }
        }
        return enumSet;
    }
Returns a non-null {@link EnumSet} containing all non-null items.

@param type The class of the {@link Enum} for use when constructing an empty {@link EnumSet}.
@return A non-null {@link EnumSet}.
stroom-util-shared/src/main/java/stroom/util/shared/NullSafe.java