public void shuffle() {
        Random rand = new Random();
        for (int i = 0; i < cardPile.size(); i++) {
            cardPile.add(rand.nextInt(i + 1), cardPile.removeLast());
        }

        if (component != null) {
            component.updateTopCard();
        }
    }