private List<Card> pairedHandSorter(List<Card> cards) {
        List<Card> sorted = new ArrayList<Card>();
        Map<Rank, List<Card>> occurencesOfRank = new EnumMap<Rank, List<Card>>(Rank.class);

        for (int i = 0; i < cards.size(); i++) {
            Card card = cards.get(i);
            Rank rank = card.getRank();
            if (!occurencesOfRank.containsKey(rank)) {
                occurencesOfRank.put(rank, new ArrayList<Card>());
            }
            occurencesOfRank.get(rank).add(card);
        }
        
        List<List<Card>> listsOfCardsByRank = new ArrayList<List<Card>>();       
        listsOfCardsByRank.addAll(occurencesOfRank.values());
        
        Collections.sort(listsOfCardsByRank, new SameHandTypeComparator.CardListComparator());
        
        for (List<Card> listOfCards : listsOfCardsByRank) {
            for (Card card : listOfCards) {
                sorted.add(card);
            }
        }
        
        return sorted;
    }