docs: public T[] nextPermutationAsArray(T[] destination)
      {
          if (destination.length != elements.length)
          {
              throw new IllegalArgumentException("Destination array must be the same length as permutations.");
          }
          generateNextPermutationIndices();
          // Generate actual permutation.
          for (int i = 0; i < permutationIndices.length; i++)
          {
              destination[i] = elements[permutationIndices[i]];
          }
          return destination;
      }