private void createDeck() {
        int deckSize = hasJoker ? DECK_SIZE + JOKERS_COUNT : DECK_SIZE;
        cards = new Card[deckSize];
        int i = 0;
        for (Suit suit : Suit.values()) {
            for (Rank rank : Rank.values()) {
                if (rank.equals(Rank.JOKER)) continue;
                cards[i] = new Card(suit, rank);
                i++;
            }
        }
        if (hasJoker) {
            for (int j = 0; j < JOKERS_COUNT; j++) {
                cards[i] = new Card(null, Rank.JOKER);
                i++;
            }
        }
    }