docs: public static <T> int[] rank(
  		final Seq<? extends T> set,
  		final Comparator<? super T> dominance
  	) {
  		// Pre-compute the dominance relations.
  		final int[][] d = new int[set.size()][set.size()];
  		for (int i = 0; i < set.size(); ++i) {
  			for (int j = i + 1; j < set.size(); ++j) {
  				d[i][j] = dominance.compare(set.get(i), set.get(j));
  				d[j][i] = -d[i][j];
  			}
  		}
  
  		// Compute for each element p the element q that it dominates and the
  		// number of times it is dominated. Using the names as defined in the
  		// referenced paper.
  		final int[] nq = new int[set.size()];
  		final List<IntList> fronts = new ArrayList<>();
  		IntList Fi = new IntList();
  
  		for (int p = 0; p < set.size(); ++p) {
  			final IntList Sp = new IntList();
  			int np = 0;
  
  			for (int q = 0; q < set.size(); ++q) {
  				if (p != q) {
  					// If p dominates q, add q to the set of solutions
  					// dominated by p.
  					if (d[p][q] > 0) {
  						Sp.add(q);
  
  					// Increment the domination counter of p.
  					} else if (d[q][p] > 0) {
  						np += 1;
  					}
  				}
  			}
  
  			// p belongs to the first front.
  			if (np == 0) {
  				Fi.add(p);
  			}
  
  			fronts.add(Sp);
  			nq[p] = np;
  		}
  
  		// Initialize the front counter.
  		int i = 0;
  		final int[] ranks = new int[set.size()];
  		while (!Fi.isEmpty()) {
  			// Used to store the members of the next front.
  			final IntList Q = new IntList();
  
  			for (int p = 0; p < Fi.size(); ++p) {
  				final int fi = Fi.get(p);
  				ranks[fi] = i;
  
  				// Update the dominated counts as compute next front.
  				for (int k = 0, n = fronts.get(fi).size(); k < n; ++k) {
  					final int q = fronts.get(fi).get(k);
  					nq[q] -= 1;
  
  					// q belongs to the next front.
  					if (nq[q] == 0) {
  						Q.add(q);
  					}
  				}
  			}
  
  			++i;
  			Fi = Q;
  		}
  
  		return ranks;
  	}