156157158159160161162163164165166
return EnumSet.copyOf(cards); } public boolean isAllSameSuite() { final Iterator<Card> iterator = iterator(); final Suit suit = iterator.next().getSuit(); while (iterator.hasNext()) { if (suit != iterator.next().getSuit()) { return false; } }
40414243444546474849
final Deck deck = Deck.createTruelyRandomDeck(); final List<Card> list = deck.deal(52); for (final Card card : list) { final Rank rank = card.getRank(); final Suit suit = card.getSuit(); cardMap.put(new CardShell(rank, suit), card); } }