@Test public void cardsAreImmutable() { var ecCards = this.ecDeck.getCards().castToList(); Verify.assertThrows( UnsupportedOperationException.class, () -> ecCards.remove(0)); Verify.assertThrows( UnsupportedOperationException.class, ecCards::clear); Verify.assertThrows( UnsupportedOperationException.class, () -> ecCards.add(null)); }
public ImmutableList<Card> getCards() { return this.cards; }
EclipseCollectionsDeckOfCardsAsList { public ImmutableList<Card> getCards() { return this.cards; } }
EclipseCollectionsDeckOfCardsAsList { public ImmutableList<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsList(); }
EclipseCollectionsDeckOfCardsAsList { public ImmutableList<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsList(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands(
            MutableStack<Card> shuffled,
            int hands,
            int cardsPerHand); ImmutableList<Card> diamonds(); ImmutableList<Card> hearts(); ImmutableList<Card> spades(); ImmutableList<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableList<Card> getCards(); ImmutableListMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsList { public ImmutableList<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsList(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands(
            MutableStack<Card> shuffled,
            int hands,
            int cardsPerHand); ImmutableList<Card> diamonds(); ImmutableList<Card> hearts(); ImmutableList<Card> spades(); ImmutableList<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableList<Card> getCards(); ImmutableListMultimap<Suit, Card> getCardsBySuit();  }