### Question:
CardDeck extends CardList { @Override public boolean add(final Card card) { if (size() == MAX_CARDS) { throw new IllegalStateException("Card deck is already filled with " + MAX_CARDS + " cards."); } if (contains(card)) { throw new IllegalArgumentException("Card " + card + " is already contained in card deck."); } return super.add(card); } CardDeck();  CardDeck(List<Card> foreHandCards, List<Card> middleHandCards,
			List<Card> rearHandCards, List<Card> skatCards);  CardDeck(String foreHandCards, String middleHandCards,
			String rearHandCards, String skatCards);  CardDeck(final String cards);  CardDeck(final CardList cards); @Override boolean add(final Card card); static EnumSet<Card> getAllCards(); static CardDeck getPerfectDistribution(); void shuffle(); final static Map<Suit, List<Card>> SUIT_CARDS; final static Map<Rank, List<Card>> RANK_CARDS; }### Answer:
@Test public void addDoubleCard() { assertThrows(IllegalArgumentException.class, () -> { final CardDeck cards = new CardDeck(); cards.remove(Card.CA); cards.add(Card.CJ); }); }
@Test public void addTooMuchCards() { assertThrows(IllegalStateException.class, () -> { final CardDeck cards = new CardDeck( "CJ SJ HJ CK CQ SK C7 C8 S7 H7 D7 DJ CA CT C9 SQ HA HK HQ S8 H8 H9 HT SA ST S9 D8 D9 DT DA DK DQ"); cards.add(Card.CJ); }); }