Deck { public Set<Card> getCards() { return ImmutableSet.copyOf(stock); } Deck(); Set<Card> getCards(); PokerHand whiteHand(String card1, String card2, String card3, String card4, String card5); PokerHand blackHand(String card1, String card2, String card3, String card4, String card5); PokerHand white(); PokerHand black();  }
@Test(expected = UnsupportedOperationException.class) public void with_a_deck_should_not_remove_a_card() throws Exception { Deck deck = new Deck(); deck.getCards().remove(new Card("2♣")); }
@Test public void with_a_deck_should_contain_all_cards() throws Exception { Deck deck = new Deck(); assertThat(deck.getCards()).hasSize(52); assertThat(transform(newArrayList(deck.getCards()), new Function<Card, String>() { @Override public String apply(Card o) { return o.toString(); } })).containsOnly("2♣", "3♣", "4♣", "5♣", "6♣", "7♣", "8♣", "9♣", "10♣", "J♣", "Q♣", "K♣", "A♣", "2♥", "3♥", "4♥", "5♥", "6♥", "7♥", "8♥", "9♥", "10♥", "J♥", "Q♥", "K♥", "A♥", "2♦", "3♦", "4♦", "5♦", "6♦", "7♦", "8♦", "9♦", "10♦", "J♦", "Q♦", "K♦", "A♦", "2♠", "3♠", "4♠", "5♠", "6♠", "7♠", "8♠", "9♠", "10♠", "J♠", "Q♠", "K♠", "A♠"); }