@Test public void deal() { Deque<Card> jdk1Shuffle = this.jdk1Deck.shuffle(new Random(1)); Deque<Card> jdk2Shuffle = this.jdk2Deck.shuffle(new Random(1)); Set<Card> jdk1Hand = this.jdk1Deck.deal(jdk1Shuffle, 5); Set<Card> jdk2Hand = this.jdk2Deck.deal(jdk2Shuffle, 5); Assert.assertEquals(jdk1Hand, jdk2Hand); }
public Set<Card> deal(Deque<Card> deque, int count) { Set<Card> hand = new HashSet<>(); IntStream.range(0, count).forEach(i -> hand.add(deque.pop())); return hand; }
JDK8DeckOfCardsAsSortedSet { public Set<Card> deal(Deque<Card> deque, int count) { Set<Card> hand = new HashSet<>(); IntStream.range(0, count).forEach(i -> hand.add(deque.pop())); return hand; } }
JDK8DeckOfCardsAsSortedSet { public Set<Card> deal(Deque<Card> deque, int count) { Set<Card> hand = new HashSet<>(); IntStream.range(0, count).forEach(i -> hand.add(deque.pop())); return hand; } JDK8DeckOfCardsAsSortedSet(); }
JDK8DeckOfCardsAsSortedSet { public Set<Card> deal(Deque<Card> deque, int count) { Set<Card> hand = new HashSet<>(); IntStream.range(0, count).forEach(i -> hand.add(deque.pop())); return hand; } JDK8DeckOfCardsAsSortedSet(); 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(); Map<Suit, Long> countsBySuit(); Map<Rank, Long> countsByRank(); SortedSet<Card> getCards(); Map<Suit, SortedSet<Card>> getCardsBySuit(); }
JDK8DeckOfCardsAsSortedSet { public Set<Card> deal(Deque<Card> deque, int count) { Set<Card> hand = new HashSet<>(); IntStream.range(0, count).forEach(i -> hand.add(deque.pop())); return hand; } JDK8DeckOfCardsAsSortedSet(); 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(); Map<Suit, Long> countsBySuit(); Map<Rank, Long> countsByRank(); SortedSet<Card> getCards(); Map<Suit, SortedSet<Card>> getCardsBySuit();  }