code: @SuppressWarnings("all")
      public static <T> Set<T> toTypedSet(Object data, Class<T> type) {
          Set<T> setResult = new HashSet<>();
          if (data == null) {
              return setResult;
          }
          if (data instanceof Collection) {
              Collection collection = (Collection) data;
              for (Object o : collection) {
                  setResult.add(Reflection.toType(o, type));
              }
              return setResult;
          }
          if (data.getClass().isArray()) {
              for (Object o : ArrayUtil.toObjectArray(data)) {
                  setResult.add(Reflection.toType(o, type));
              }
              return setResult;
          }
          setResult.add(Reflection.toType(data, type));
          return setResult;
      }
docs: Adapt the data object to the given typed hash set, it is safe to make a cast even if the given data is not a set,
  or the element is not the given type.
  
  @param data the guessed data object
  @param type the element type
  @param <T>  the generic type
  @return a newly created hash set contains all the data