@Test
public void applyTest() {

    final List<Permutation> all = new ArrayList<Permutation>();
    int size = 4;
    PermutationGroup group = PermutationGroup.makeSymN(size);
    group.apply(new PermutationGroup.Backtracker() {
        @Override
        public boolean isFinished() {
            return false;
        }
        @Override
        public void applyTo(Permutation p) {
            all.add(p);
        }
    });
    Assert.assertEquals(factorial(size), all.size());
}