code: public static <T> List<T> distinct(final T[] a, final int fromIndex, final int toIndex) {
          checkFromToIndex(fromIndex, toIndex, len(a));
  
          if (N.isNullOrEmpty(a)) {
              return new ArrayList<>();
          }
  
          final List<T> result = new ArrayList<>();
          final Set<Object> set = new HashSet<>();
  
          for (int i = fromIndex; i < toIndex; i++) {
              if (set.add(hashKey(a[i]))) {
                  result.add(a[i]);
              }
          }
  
          return result;
      }
docs: Mostly it's designed for one-step operation to complete the operation in one step.
  <code>java.util.stream.Stream</code> is preferred for multiple phases operation.
  
  @param a
  @param fromIndex
  @param toIndex
  @return