@Test
public void rankMax() {

	final Random random = new Random(123123);
	final ISeq<Vec<double[]>> rank0 = frontMax(20, 50, random);
	final ISeq<Vec<double[]>> rank1 = frontMax(15, 50, random);
	final ISeq<Vec<double[]>> rank2 = frontMax(10, 50, random);
	final ISeq<Vec<double[]>> rank3 = frontMax(5, 50, random);
	final ISeq<Vec<double[]>> rank4 = frontMax(1, 50, random);
	final ISeq<Vec<double[]>> points = rank0
		.append(rank1)
		.append(rank2)
		.append(rank3)
		.append(rank4);
	final int[] rank = Pareto.rank(points);
	Assert.assertEquals(
		IntStream.range(0, points.size())
			.filter(i -> rank[i] == 0)
			.mapToObj(points)
			.collect(Collectors.toSet()),
		new HashSet<>(rank0.asList())
	);
	Assert.assertEquals(
		IntStream.range(0, points.size())
			.filter(i -> rank[i] == 1)
			.mapToObj(points)
			.collect(Collectors.toSet()),
		new HashSet<>(rank1.asList())
	);
	Assert.assertEquals(
		IntStream.range(0, points.size())
			.filter(i -> rank[i] == 2)
			.mapToObj(points)
			.collect(Collectors.toSet()),
		new HashSet<>(rank2.asList())
	);
	Assert.assertEquals(
		IntStream.range(0, points.size())
			.filter(i -> rank[i] == 3)
			.mapToObj(points)
			.collect(Collectors.toSet()),
		new HashSet<>(rank3.asList())
	);
	Assert.assertEquals(
		IntStream.range(0, points.size())
			.filter(i -> rank[i] == 4)
			.mapToObj(points)
			.collect(Collectors.toSet()),
		new HashSet<>(rank4.asList())
	);
}