code: public static <T> Set<T> subSet(Set<T> original, int from, int to) {
          List<T> list = new ArrayList<>(original);
          if (to == -1) {
              to = original.size();
          }
          return new LinkedHashSet<>(list.subList(from, to));
      }
docs: Get sub-set of a set.
  @param original original set
  @param from index of start position
  @param to index of end position(exclude), but -1 means the last element
  @param <T> element type of set
  @return sub-set of original set [from, to)