@Test public void dealHands() { var jdk1Shuffled = this.jdkDeck.shuffle(new Random(1)); var jdk2Shuffled = this.customDeck.shuffle(new Random(1)); var jdk1Hands = this.jdkDeck.dealHands(jdk1Shuffled, 5, 5); var jdk2Hands = this.customDeck.dealHands(jdk2Shuffled, 5, 5); Assert.assertEquals(jdk1Hands, jdk2Hands); }
public MutableList<MutableSet<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { return MutableList.fromStream(IntStream.range(0, hands) .mapToObj(each -> this.deal(shuffled, cardsPerHand))) .asUnmodifiable(); }
CustomCollectionsDeckOfCardsAsList { public MutableList<MutableSet<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { return MutableList.fromStream(IntStream.range(0, hands) .mapToObj(each -> this.deal(shuffled, cardsPerHand))) .asUnmodifiable(); } }
CustomCollectionsDeckOfCardsAsList { public MutableList<MutableSet<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { return MutableList.fromStream(IntStream.range(0, hands) .mapToObj(each -> this.deal(shuffled, cardsPerHand))) .asUnmodifiable(); } CustomCollectionsDeckOfCardsAsList(); }
CustomCollectionsDeckOfCardsAsList { public MutableList<MutableSet<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { return MutableList.fromStream(IntStream.range(0, hands) .mapToObj(each -> this.deal(shuffled, cardsPerHand))) .asUnmodifiable(); } CustomCollectionsDeckOfCardsAsList(); Deque<Card> shuffle(Random random); MutableSet<Card> deal(Deque<Card> deque, int count); MutableList<MutableSet<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); MutableList<MutableSet<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand); MutableList<Card> diamonds(); MutableList<Card> hearts(); MutableList<Card> spades(); MutableList<Card> clubs(); MutableBag<Suit> countsBySuit(); MutableBag<Rank> countsByRank(); MutableList<Card> getCards(); MutableListMultimap<Suit, Card> getCardsBySuit(); }
CustomCollectionsDeckOfCardsAsList { public MutableList<MutableSet<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { return MutableList.fromStream(IntStream.range(0, hands) .mapToObj(each -> this.deal(shuffled, cardsPerHand))) .asUnmodifiable(); } CustomCollectionsDeckOfCardsAsList(); Deque<Card> shuffle(Random random); MutableSet<Card> deal(Deque<Card> deque, int count); MutableList<MutableSet<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); MutableList<MutableSet<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand); MutableList<Card> diamonds(); MutableList<Card> hearts(); MutableList<Card> spades(); MutableList<Card> clubs(); MutableBag<Suit> countsBySuit(); MutableBag<Rank> countsByRank(); MutableList<Card> getCards(); MutableListMultimap<Suit, Card> getCardsBySuit();  }