### Question:
ApacheCommonsDeckOfCardsAsSortedSet { public MultiValuedMap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } ApacheCommonsDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands(
            Deque<Card> shuffled,
            int hands,
            int cardsPerHand); SortedSet<Card> diamonds(); SortedSet<Card> hearts(); SortedSet<Card> spades(); SortedSet<Card> clubs(); Bag<Suit> countsBySuit(); MultiSet<Rank> countsByRank(); SortedSet<Card> getCards(); MultiValuedMap<Suit, Card> getCardsBySuit();  }### Answer:
@Test public void cardsBySuit() { Map<Suit, SortedSet<Card>> jdkCardsBySuit = this.jdkDeck.getCardsBySuit(); MultiValuedMap<Suit, Card> acCardsBySuit = this.acDeck.getCardsBySuit(); Assert.assertEquals(jdkCardsBySuit.get(Suit.CLUBS), new TreeSet<>(acCardsBySuit.get(Suit.CLUBS))); }
@Test public void cardsBySuitIsImmutable() { var acCardsBySuit = this.acDeck.getCardsBySuit(); Verify.assertThrows( UnsupportedOperationException.class, () -> acCardsBySuit.remove(Suit.CLUBS)); Verify.assertThrows( UnsupportedOperationException.class, acCardsBySuit::clear); Verify.assertThrows( UnsupportedOperationException.class, () -> acCardsBySuit.get(Suit.CLUBS).remove(null)); Verify.assertThrows( UnsupportedOperationException.class, () -> acCardsBySuit.get(Suit.CLUBS).add(null)); Verify.assertThrows( UnsupportedOperationException.class, acCardsBySuit.get(Suit.CLUBS)::clear); }