### Question:
JDKImperativeDeckOfCardsAsList { public Map<Suit, Long> countsBySuit() { var result = new HashMap<Suit, Long>(); for (var card : this.cards) { var suit = card.suit(); var value = result.computeIfAbsent(suit, s -> Long.valueOf(0)); result.put(suit, value + 1); } return result; } JDKImperativeDeckOfCardsAsList(); 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); List<Card> diamonds(); List<Card> hearts(); List<Card> spades(); List<Card> clubs(); Map<Suit, Long> countsBySuit(); Map<Rank, Long> countsByRank(); List<Card> getCards(); Map<Suit, List<Card>> getCardsBySuit();  }### Answer:
@Test public void countsBySuit() { Assert.assertEquals(Long.valueOf(13), this.jdkDeck.countsBySuit().get(Suit.CLUBS)); }