code: public List<Permutation> transversal(final PermutationGroup subgroup) {
          final long m = this.order() / subgroup.order();
          final List<Permutation> results = new ArrayList<Permutation>();
          Backtracker transversalBacktracker = new Backtracker() {
  
              private boolean finished = false;
  
              @Override
              public void applyTo(Permutation p) {
                  for (Permutation f : results) {
                      Permutation h = f.invert().multiply(p);
                      if (subgroup.test(h) == size) {
                          return;
                      }
                  }
                  results.add(p);
                  if (results.size() >= m) {
                      this.finished = true;
                  }
              }
  
              @Override
              public boolean isFinished() {
                  return finished;
              }
  
          };
          this.apply(transversalBacktracker);
          return results;
      }
docs: Generate a transversal of a subgroup in this group.
  
  @param subgroup the subgroup to use for the transversal
  @return a list of permutations