code: public List<Integer> getOrbit(int element) {
          List<Integer> orbit = new ArrayList<Integer>();
          orbit.add(element);
          int i = values[element];
          while (i != element && orbit.size() < values.length) {
              orbit.add(i);
              i = values[i];
          }
          return orbit;
      }
docs: Get all the elements in the same orbit in the permutation (unsorted).
  
  @param element any element in the orbit
  @return the list of elements reachable in this permutation