groupBy equal on rank can be replaced with group ranks.