[utils,tests] add minmax_candidates()