@Test public void cardsBySuitIsImmutable() { var ggCardsBySuit = this.ggDeck.getCardsBySuit(); Verify.assertThrows( UnsupportedOperationException.class, () -> ggCardsBySuit.removeAll(Suit.CLUBS)); Verify.assertThrows( UnsupportedOperationException.class, ggCardsBySuit::clear); Verify.assertThrows( UnsupportedOperationException.class, () -> ggCardsBySuit.get(Suit.CLUBS).remove(0)); Verify.assertThrows( UnsupportedOperationException.class, () -> ggCardsBySuit.get(Suit.CLUBS).add(null)); Verify.assertThrows( UnsupportedOperationException.class, ggCardsBySuit.get(Suit.CLUBS)::clear); }
public ImmutableListMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; }
GoogleGuavaDeckOfCardsAsList { public ImmutableListMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } }
GoogleGuavaDeckOfCardsAsList { public ImmutableListMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } GoogleGuavaDeckOfCardsAsList(); }
GoogleGuavaDeckOfCardsAsList { public ImmutableListMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } GoogleGuavaDeckOfCardsAsList(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand); ImmutableList<Card> diamonds(); ImmutableList<Card> hearts(); ImmutableList<Card> spades(); ImmutableList<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableList<Card> getCards(); ImmutableListMultimap<Suit, Card> getCardsBySuit(); }
GoogleGuavaDeckOfCardsAsList { public ImmutableListMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } GoogleGuavaDeckOfCardsAsList(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand); ImmutableList<Card> diamonds(); ImmutableList<Card> hearts(); ImmutableList<Card> spades(); ImmutableList<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableList<Card> getCards(); ImmutableListMultimap<Suit, Card> getCardsBySuit();  }