code: public static StreamEx<int[]> ofCombinations(int n, int k) {
          checkNonNegative("k", k);
          checkNonNegative("n", n);
          if (k > n) {
              return StreamEx.empty();
          }
          if (k == 0) {
              return StreamEx.of(new int[0]);
          }
          long size = CombinationSpliterator.cnk(n, k);
          int[] value = new int[k];
          for (int i = 0; i < k; i++) {
              value[i] = i;
          }
  
          return StreamEx.of(new CombinationSpliterator(n, size, 0, value));
      }
docs: Returns a new {@code StreamEx} of {@code int[]} arrays containing all the possible combinations of length {@code
  k} consisting of numbers from 0 to {@code n-1} in lexicographic order.
  <p>
  Example: {@code StreamEx.ofCombinations(3, 2)} returns the stream of three elements: {@code [0, 1]}, {@code [0,
  2]} and {@code [1, 2]} in this order.
  
  @param n number of possible distinct elements
  @param k number of elements in each combination
  @return new sequential stream of possible combinations. Returns an empty stream if {@code k} is bigger
  than {@code n}.
  @throws IllegalArgumentException if n or k is negative or number of possible combinations exceeds {@code
  Long.MAX_VALUE}.
  @since 0.6.7