Implement a generic version of the permutation generator in Section 13.2. Generate all permutations of a List<E>.

Complete the following file:

PermutationGenerator.java

Use the following file:

PermutationTester.java

import java.util.ArrayList;
import java.util.List;

/**
   This program tests the permutation generator.
*/
public class PermutationTester
{
   public static void main(String[] args)
   {
      ArrayList<String> list = new ArrayList<String>();
      list.add("e");
      list.add("a");
      list.add("t");
      PermutationGenerator<String> generator 
            = new PermutationGenerator<String>(list);
      ArrayList<List<String>> permutations = generator.getPermutations();
      System.out.println(permutations.get(0));
      System.out.println("Expected: [e, a, t]");
      System.out.println(permutations.get(1));
      System.out.println("Expected: [e, t, a]");
      System.out.println(permutations.get(2));
      System.out.println("Expected: [a, e, t]");

      System.out.println(permutations.size());
      System.out.println("Expected: 6");
   }
}