code: public List<T> nextPermutationAsList(List<T> destination)
      {
          generateNextPermutationIndices();
          // Generate actual permutation.
          destination.clear();
          for (int i : permutationIndices)
          {
              destination.add(elements[i]);
          }
          return destination;
      }
docs: Generate the next permutation and return a list containing
  the elements in the appropriate order.  This overloaded method
  allows the caller to provide a list that will be used and returned.
  The purpose of this is to improve performance when iterating over
  permutations.  If the {@link #nextPermutationAsList()} method is
  used it will create a new list every time.  When iterating over
  permutations this will result in lots of short-lived objects that
  have to be garbage collected.  This method allows a single list
  instance to be reused in such circumstances.
  @param destination Provides a list to use to create the
  permutation.  This is the list that will be returned, once
  it has been filled with the elements in the appropriate order.
  @return The next permutation as a list.