PermutationGroup { public static PermutationGroup makeSymN(int size) { List<Permutation> generators = new ArrayList<Permutation>(); int[] p1 = new int[size]; p1[0] = 1; p1[1] = 0; for (int i = 2; i < size; i++) { p1[i] = i; } int[] p2 = new int[size]; p2[0] = 1; for (int i = 1; i < size - 1; i++) { p2[i] = i + 1; } p2[size - 1] = 0; generators.add(new Permutation(p1)); generators.add(new Permutation(p2)); return new PermutationGroup(size, generators); } PermutationGroup(int size);  PermutationGroup(Permutation base);  PermutationGroup(int size, List<Permutation> generators); static PermutationGroup makeSymN(int size); int getSize(); long order(); Permutation get(int uIndex, int uSubIndex); List<Permutation> getLeftTransversal(int index); List<Permutation> transversal(final PermutationGroup subgroup); void apply(Backtracker backtracker); List<Permutation> all(); void changeBase(Permutation newBase); void enter(Permutation g); int test(Permutation permutation); @Override String toString();  }
@Test public void makeSymNTest() { int size = 4; PermutationGroup sym = PermutationGroup.makeSymN(size); Assert.assertEquals(size, sym.getSize()); Assert.assertEquals(factorial(size), sym.order()); }