docs: public List<T> nextPermutationAsList(List<T> destination)
      {
          generateNextPermutationIndices();
          // Generate actual permutation.
          destination.clear();
          for (int i : permutationIndices)
          {
              destination.add(elements[i]);
          }
          return destination;
      }