Sort groupByRanks()'s result by rank
Complete test case of generateStraight()