def METHOD_NAME() -> None:
    candidates, expected_frontiers = get_nsga2_test_case_data()
    n_selected = len(expected_frontiers[0]) + len(expected_frontiers[1]) - 1
    rank_result = nsga2.rank(candidates, n_selected)
    assert len(rank_result) == n_selected
    # Check the first frontier
    max_rank_frontier1 = 0
    for c in expected_frontiers[0]:
        assert rank_result[c.uid][2] == float("inf")
        max_rank_frontier1 = max(max_rank_frontier1, rank_result[c.uid][0])
    # Check the second frontier
    n_cand_in_frontier2 = 0
    for c in expected_frontiers[1]:
        if c.uid in rank_result:
            n_cand_in_frontier2 += 1
            assert rank_result[c.uid][0] > max_rank_frontier1
    assert n_cand_in_frontier2 == len(expected_frontiers[1]) - 1