target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void allCards() { Assert.assertEquals(this.jdk1Deck.getCards(), this.jdk2Deck.getCards()); }
public List<Card> getCards() { return this.cards; }
JDK8DeckOfCardsAsList { public List<Card> getCards() { return this.cards; } }
JDK8DeckOfCardsAsList { public List<Card> getCards() { return this.cards; } JDK8DeckOfCardsAsList(); }
JDK8DeckOfCardsAsList { public List<Card> getCards() { return this.cards; } JDK8DeckOfCardsAsList(); 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(); }
JDK8DeckOfCardsAsList { public List<Card> getCards() { return this.cards; } JDK8DeckOfCardsAsList(); 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(); }
@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(); }
@Test public void shuffleAndDealHands() { List<Set<Card>> jdk1Hands = this.jdk1Deck.shuffleAndDeal(new Random(1), 5, 5); List<Set<Card>> jdk2Hands = this.jdk2Deck.shuffleAndDeal(new Random(1), 5, 5); Assert.assertEquals(jdk1Hands, jdk2Hands); }
public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); }
JDK8DeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } }
JDK8DeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } JDK8DeckOfCardsAsSortedSet(); }
JDK8DeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } 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 List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } 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(); }
@Test public void dealHands() { Deque<Card> jdk1Shuffled = this.jdk1Deck.shuffle(new Random(1)); Deque<Card> jdk2Shuffled = this.jdk2Deck.shuffle(new Random(1)); List<Set<Card>> jdk1Hands = this.jdk1Deck.dealHands(jdk1Shuffled, 5, 5); List<Set<Card>> jdk2Hands = this.jdk2Deck.dealHands(jdk2Shuffled, 5, 5); Assert.assertEquals(jdk1Hands, jdk2Hands); }
public List<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; }
JDK8DeckOfCardsAsSortedSet { public List<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } }
JDK8DeckOfCardsAsSortedSet { public List<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } JDK8DeckOfCardsAsSortedSet(); }
JDK8DeckOfCardsAsSortedSet { public List<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } 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 List<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } 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(); }
@Test public void cardsBySuit() { Map<Suit, SortedSet<Card>> jdk1CardsBySuit = this.jdk1Deck.getCardsBySuit(); Map<Suit, SortedSet<Card>> jdk2CardsBySuit = this.jdk2Deck.getCardsBySuit(); Assert.assertEquals(jdk1CardsBySuit.get(Suit.CLUBS), jdk2CardsBySuit.get(Suit.CLUBS)); }
public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; }
JDK8DeckOfCardsAsSortedSet { public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } }
JDK8DeckOfCardsAsSortedSet { public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } JDK8DeckOfCardsAsSortedSet(); }
JDK8DeckOfCardsAsSortedSet { public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } 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 Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } 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(); }
@Test public void cardsBySuitIsImmutable() { var jdk2CardsBySuit = this.jdk2Deck.getCardsBySuit(); Verify.assertThrows( UnsupportedOperationException.class, () -> jdk2CardsBySuit.remove(Suit.CLUBS)); Verify.assertThrows( UnsupportedOperationException.class, jdk2CardsBySuit::clear); Verify.assertThrows( UnsupportedOperationException.class, () -> jdk2CardsBySuit.get(Suit.CLUBS).remove(null)); Verify.assertThrows( UnsupportedOperationException.class, () -> jdk2CardsBySuit.get(Suit.CLUBS).add(null)); Verify.assertThrows( UnsupportedOperationException.class, jdk2CardsBySuit.get(Suit.CLUBS)::clear); }
public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; }
JDK8DeckOfCardsAsSortedSet { public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } }
JDK8DeckOfCardsAsSortedSet { public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } JDK8DeckOfCardsAsSortedSet(); }
JDK8DeckOfCardsAsSortedSet { public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } 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 Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } 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(); }
@Test public void countsBySuit() { Assert.assertEquals( this.jdk1Deck.countsBySuit().get(Suit.CLUBS), this.jdk2Deck.countsBySuit().get(Suit.CLUBS)); }
public Map<Suit, Long> countsBySuit() { return null; }
JDK8DeckOfCardsAsSortedSet { public Map<Suit, Long> countsBySuit() { return null; } }
JDK8DeckOfCardsAsSortedSet { public Map<Suit, Long> countsBySuit() { return null; } JDK8DeckOfCardsAsSortedSet(); }
JDK8DeckOfCardsAsSortedSet { public Map<Suit, Long> countsBySuit() { return null; } 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 Map<Suit, Long> countsBySuit() { return null; } 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(); }
@Test public void countsByRank() { Assert.assertEquals( this.jdk1Deck.countsByRank().get(Rank.TEN), this.jdk2Deck.countsByRank().get(Rank.TEN)); }
public Map<Rank, Long> countsByRank() { return null; }
JDK8DeckOfCardsAsSortedSet { public Map<Rank, Long> countsByRank() { return null; } }
JDK8DeckOfCardsAsSortedSet { public Map<Rank, Long> countsByRank() { return null; } JDK8DeckOfCardsAsSortedSet(); }
JDK8DeckOfCardsAsSortedSet { public Map<Rank, Long> countsByRank() { return null; } 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 Map<Rank, Long> countsByRank() { return null; } 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(); }
@Test public void allCards() { Assert.assertEquals(this.jdkDeck.getCards(), this.vavrDeck.getCards().toJavaSet()); }
public SortedSet<Card> getCards() { return this.cards; }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } VavrDeckOfCardsAsSortedSet(); }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
@Test public void diamonds() { Assert.assertEquals(this.jdkDeck.diamonds(), this.vavrDeck.diamonds().toJavaSet()); }
public SortedSet<Card> diamonds() { return null; }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return null; } }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return null; } VavrDeckOfCardsAsSortedSet(); }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return null; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return null; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
@Test public void hearts() { Assert.assertEquals(this.jdkDeck.hearts(), this.vavrDeck.hearts().toJavaSet()); }
public SortedSet<Card> hearts() { return null; }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return null; } }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return null; } VavrDeckOfCardsAsSortedSet(); }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return null; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return null; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
@Test public void cardsAreImmutable() { var jdk2Cards = this.jdk2Deck.getCards(); Verify.assertThrows( UnsupportedOperationException.class, () -> jdk2Cards.remove(0)); Verify.assertThrows( UnsupportedOperationException.class, jdk2Cards::clear); Verify.assertThrows( UnsupportedOperationException.class, () -> jdk2Cards.add(null)); }
public List<Card> getCards() { return this.cards; }
JDK8DeckOfCardsAsList { public List<Card> getCards() { return this.cards; } }
JDK8DeckOfCardsAsList { public List<Card> getCards() { return this.cards; } JDK8DeckOfCardsAsList(); }
JDK8DeckOfCardsAsList { public List<Card> getCards() { return this.cards; } JDK8DeckOfCardsAsList(); 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(); }
JDK8DeckOfCardsAsList { public List<Card> getCards() { return this.cards; } JDK8DeckOfCardsAsList(); 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(); }
@Test public void spades() { Assert.assertEquals(this.jdkDeck.spades(), this.vavrDeck.spades().toJavaSet()); }
public SortedSet<Card> spades() { return null; }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return null; } }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return null; } VavrDeckOfCardsAsSortedSet(); }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return null; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return null; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
@Test public void clubs() { Assert.assertEquals(this.jdkDeck.clubs(), this.vavrDeck.clubs().toJavaSet()); }
public SortedSet<Card> clubs() { return null; }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return null; } }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return null; } VavrDeckOfCardsAsSortedSet(); }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return null; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
VavrDeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return null; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
@Test public void deal() { Deque<Card> jdkShuffle = this.jdkDeck.shuffle(new Random(1)); io.vavr.collection.List<Card> vavrShuffle = this.vavrDeck.shuffle(new Random(1)); Set<Card> jdkHand = this.jdkDeck.deal(jdkShuffle, 5); Set<Card> vavrHand = this.vavrDeck.deal(vavrShuffle, 5)._1().toJavaSet(); Assert.assertEquals(jdkHand, vavrHand); }
public Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count) { Set<Card> hand = HashSet.empty(); for (int i = 0; i < count; i++) { Tuple2<Card, ? extends List<Card>> cardTuple2 = stack.pop2(); stack = cardTuple2._2(); hand = hand.add(cardTuple2._1()); } return Tuple.of(hand, stack); }
VavrDeckOfCardsAsSortedSet { public Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count) { Set<Card> hand = HashSet.empty(); for (int i = 0; i < count; i++) { Tuple2<Card, ? extends List<Card>> cardTuple2 = stack.pop2(); stack = cardTuple2._2(); hand = hand.add(cardTuple2._1()); } return Tuple.of(hand, stack); } }
VavrDeckOfCardsAsSortedSet { public Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count) { Set<Card> hand = HashSet.empty(); for (int i = 0; i < count; i++) { Tuple2<Card, ? extends List<Card>> cardTuple2 = stack.pop2(); stack = cardTuple2._2(); hand = hand.add(cardTuple2._1()); } return Tuple.of(hand, stack); } VavrDeckOfCardsAsSortedSet(); }
VavrDeckOfCardsAsSortedSet { public Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count) { Set<Card> hand = HashSet.empty(); for (int i = 0; i < count; i++) { Tuple2<Card, ? extends List<Card>> cardTuple2 = stack.pop2(); stack = cardTuple2._2(); hand = hand.add(cardTuple2._1()); } return Tuple.of(hand, stack); } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
VavrDeckOfCardsAsSortedSet { public Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count) { Set<Card> hand = HashSet.empty(); for (int i = 0; i < count; i++) { Tuple2<Card, ? extends List<Card>> cardTuple2 = stack.pop2(); stack = cardTuple2._2(); hand = hand.add(cardTuple2._1()); } return Tuple.of(hand, stack); } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
@Test public void shuffleAndDealHands() { List<Set<Card>> jdkHands = this.jdkDeck.shuffleAndDeal(new Random(1), 5, 5); io.vavr.collection.List<io.vavr.collection.Set<Card>> vavrHands = this.vavrDeck.shuffleAndDeal(new Random(1), 5, 5); Assert.assertEquals(jdkHands.get(0), vavrHands.get(0).toJavaSet()); Assert.assertEquals(jdkHands.get(1), vavrHands.get(1).toJavaSet()); Assert.assertEquals(jdkHands.get(2), vavrHands.get(2).toJavaSet()); Assert.assertEquals(jdkHands.get(3), vavrHands.get(3).toJavaSet()); Assert.assertEquals(jdkHands.get(4), vavrHands.get(4).toJavaSet()); }
public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { List<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); }
VavrDeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { List<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } }
VavrDeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { List<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } VavrDeckOfCardsAsSortedSet(); }
VavrDeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { List<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
VavrDeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { List<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
@Test public void dealHands() { Deque<Card> jdkShuffled = this.jdkDeck.shuffle(new Random(1)); io.vavr.collection.List<Card> vavrShuffled = this.vavrDeck.shuffle(new Random(1)); List<Set<Card>> jdkHands = this.jdkDeck.dealHands(jdkShuffled, 5, 5); io.vavr.collection.List<io.vavr.collection.Set<Card>> vavrHands = this.vavrDeck.dealHands(vavrShuffled, 5, 5); Assert.assertEquals(jdkHands.get(0), vavrHands.get(0).toJavaSet()); Assert.assertEquals(jdkHands.get(1), vavrHands.get(1).toJavaSet()); Assert.assertEquals(jdkHands.get(2), vavrHands.get(2).toJavaSet()); Assert.assertEquals(jdkHands.get(3), vavrHands.get(3).toJavaSet()); Assert.assertEquals(jdkHands.get(4), vavrHands.get(4).toJavaSet()); }
public List<Set<Card>> dealHands( List<Card> shuffled, int hands, int cardsPerHand) { return null; }
VavrDeckOfCardsAsSortedSet { public List<Set<Card>> dealHands( List<Card> shuffled, int hands, int cardsPerHand) { return null; } }
VavrDeckOfCardsAsSortedSet { public List<Set<Card>> dealHands( List<Card> shuffled, int hands, int cardsPerHand) { return null; } VavrDeckOfCardsAsSortedSet(); }
VavrDeckOfCardsAsSortedSet { public List<Set<Card>> dealHands( List<Card> shuffled, int hands, int cardsPerHand) { return null; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
VavrDeckOfCardsAsSortedSet { public List<Set<Card>> dealHands( List<Card> shuffled, int hands, int cardsPerHand) { return null; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
@Test public void cardsBySuit() { Map<Suit, SortedSet<Card>> jdkCardsBySuit = this.jdkDeck.getCardsBySuit(); io.vavr.collection.Map<Suit, ? extends io.vavr.collection.SortedSet<Card>> vavrCardsBySuit = this.vavrDeck.getCardsBySuit(); Assert.assertEquals(jdkCardsBySuit.get(Suit.CLUBS), vavrCardsBySuit.get(Suit.CLUBS).get().toJavaList()); }
public Map<Suit, ? extends SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; }
VavrDeckOfCardsAsSortedSet { public Map<Suit, ? extends SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } }
VavrDeckOfCardsAsSortedSet { public Map<Suit, ? extends SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } VavrDeckOfCardsAsSortedSet(); }
VavrDeckOfCardsAsSortedSet { public Map<Suit, ? extends SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
VavrDeckOfCardsAsSortedSet { public Map<Suit, ? extends SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
@Test public void countsBySuit() { Assert.assertEquals( this.jdkDeck.countsBySuit().get(Suit.CLUBS), this.vavrDeck.countsBySuit().get(Suit.CLUBS).get()); }
public Map<Suit, Long> countsBySuit() { return null; }
VavrDeckOfCardsAsSortedSet { public Map<Suit, Long> countsBySuit() { return null; } }
VavrDeckOfCardsAsSortedSet { public Map<Suit, Long> countsBySuit() { return null; } VavrDeckOfCardsAsSortedSet(); }
VavrDeckOfCardsAsSortedSet { public Map<Suit, Long> countsBySuit() { return null; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
VavrDeckOfCardsAsSortedSet { public Map<Suit, Long> countsBySuit() { return null; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
@Test public void countsByRank() { Assert.assertEquals( this.jdkDeck.countsByRank().get(Rank.TEN), this.vavrDeck.countsByRank().get(Rank.TEN).get()); }
public Map<Rank, Long> countsByRank() { return null; }
VavrDeckOfCardsAsSortedSet { public Map<Rank, Long> countsByRank() { return null; } }
VavrDeckOfCardsAsSortedSet { public Map<Rank, Long> countsByRank() { return null; } VavrDeckOfCardsAsSortedSet(); }
VavrDeckOfCardsAsSortedSet { public Map<Rank, Long> countsByRank() { return null; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
VavrDeckOfCardsAsSortedSet { public Map<Rank, Long> countsByRank() { return null; } VavrDeckOfCardsAsSortedSet(); List<Card> shuffle(Random random); Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( List<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, ? extends SortedSet<Card>> getCardsBySuit(); }
@Test public void allCards() { Assert.assertEquals(this.jdkDeck.getCards(), this.acDeck.getCards()); }
public SortedSet<Card> getCards() { return this.cards; }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } ApacheCommonsDeckOfCardsAsSortedSet(); }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } 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(); }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } 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(); }
@Test public void cardsAreImmutable() { var acCards = this.acDeck.getCards(); Verify.assertThrows( UnsupportedOperationException.class, () -> acCards.remove(null)); Verify.assertThrows( UnsupportedOperationException.class, acCards::clear); Verify.assertThrows( UnsupportedOperationException.class, () -> acCards.add(null)); }
public SortedSet<Card> getCards() { return this.cards; }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } ApacheCommonsDeckOfCardsAsSortedSet(); }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } 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(); }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } 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(); }
@Test public void diamonds() { Assert.assertEquals(this.jdk1Deck.diamonds(), this.jdk2Deck.diamonds()); }
public List<Card> diamonds() { return null; }
JDK8DeckOfCardsAsList { public List<Card> diamonds() { return null; } }
JDK8DeckOfCardsAsList { public List<Card> diamonds() { return null; } JDK8DeckOfCardsAsList(); }
JDK8DeckOfCardsAsList { public List<Card> diamonds() { return null; } JDK8DeckOfCardsAsList(); 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(); }
JDK8DeckOfCardsAsList { public List<Card> diamonds() { return null; } JDK8DeckOfCardsAsList(); 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(); }
@Test public void diamonds() { Assert.assertEquals(this.jdkDeck.diamonds(), this.acDeck.diamonds()); }
public SortedSet<Card> diamonds() { return null; }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return null; } }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return null; } ApacheCommonsDeckOfCardsAsSortedSet(); }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return null; } 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(); }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return null; } 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(); }
@Test public void hearts() { Assert.assertEquals(this.jdkDeck.hearts(), this.acDeck.hearts()); }
public SortedSet<Card> hearts() { return null; }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return null; } }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return null; } ApacheCommonsDeckOfCardsAsSortedSet(); }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return null; } 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(); }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return null; } 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(); }
@Test public void spades() { Assert.assertEquals(this.jdkDeck.spades(), this.acDeck.spades()); }
public SortedSet<Card> spades() { return null; }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return null; } }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return null; } ApacheCommonsDeckOfCardsAsSortedSet(); }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return null; } 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(); }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return null; } 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(); }
@Test public void clubs() { Assert.assertEquals(this.jdkDeck.clubs(), this.acDeck.clubs()); }
public SortedSet<Card> clubs() { return null; }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return null; } }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return null; } ApacheCommonsDeckOfCardsAsSortedSet(); }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return null; } 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(); }
ApacheCommonsDeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return null; } 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(); }
@Test public void deal() { Deque<Card> jdkShuffle = this.jdkDeck.shuffle(new Random(1)); Deque<Card> acShuffle = this.acDeck.shuffle(new Random(1)); Set<Card> jdkHand = this.jdkDeck.deal(jdkShuffle, 5); Set<Card> acHand = this.acDeck.deal(acShuffle, 5); Assert.assertEquals(jdkHand, acHand); }
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; }
ApacheCommonsDeckOfCardsAsSortedSet { 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; } }
ApacheCommonsDeckOfCardsAsSortedSet { 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; } ApacheCommonsDeckOfCardsAsSortedSet(); }
ApacheCommonsDeckOfCardsAsSortedSet { 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; } 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(); }
ApacheCommonsDeckOfCardsAsSortedSet { 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; } 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(); }
@Test public void shuffleAndDealHands() { List<Set<Card>> jdkHands = this.jdkDeck.shuffleAndDeal(new Random(1), 5, 5); List<Set<Card>> acHands = this.acDeck.shuffleAndDeal(new Random(1), 5, 5); Assert.assertEquals(jdkHands, acHands); }
public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); }
ApacheCommonsDeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } }
ApacheCommonsDeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } ApacheCommonsDeckOfCardsAsSortedSet(); }
ApacheCommonsDeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } 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(); }
ApacheCommonsDeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } 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(); }
@Test public void dealHands() { Deque<Card> jdkShuffled = this.jdkDeck.shuffle(new Random(1)); Deque<Card> acShuffled = this.acDeck.shuffle(new Random(1)); List<Set<Card>> jdkHands = this.jdkDeck.dealHands(jdkShuffled, 5, 5); List<Set<Card>> acHands = this.acDeck.dealHands(acShuffled, 5, 5); Assert.assertEquals(jdkHands, acHands); }
public List<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; }
ApacheCommonsDeckOfCardsAsSortedSet { public List<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } }
ApacheCommonsDeckOfCardsAsSortedSet { public List<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } ApacheCommonsDeckOfCardsAsSortedSet(); }
ApacheCommonsDeckOfCardsAsSortedSet { public List<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } 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(); }
ApacheCommonsDeckOfCardsAsSortedSet { public List<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } 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(); }
@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))); }
public MultiValuedMap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; }
ApacheCommonsDeckOfCardsAsSortedSet { public MultiValuedMap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } }
ApacheCommonsDeckOfCardsAsSortedSet { public MultiValuedMap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } ApacheCommonsDeckOfCardsAsSortedSet(); }
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(); }
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(); }
@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); }
public MultiValuedMap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; }
ApacheCommonsDeckOfCardsAsSortedSet { public MultiValuedMap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } }
ApacheCommonsDeckOfCardsAsSortedSet { public MultiValuedMap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } ApacheCommonsDeckOfCardsAsSortedSet(); }
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(); }
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(); }
@Test public void countsBySuit() { Assert.assertEquals( this.jdkDeck.countsBySuit().get(Suit.CLUBS).intValue(), this.acDeck.countsBySuit().getCount(Suit.CLUBS)); }
public Bag<Suit> countsBySuit() { return null; }
ApacheCommonsDeckOfCardsAsSortedSet { public Bag<Suit> countsBySuit() { return null; } }
ApacheCommonsDeckOfCardsAsSortedSet { public Bag<Suit> countsBySuit() { return null; } ApacheCommonsDeckOfCardsAsSortedSet(); }
ApacheCommonsDeckOfCardsAsSortedSet { public Bag<Suit> countsBySuit() { return null; } 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(); }
ApacheCommonsDeckOfCardsAsSortedSet { public Bag<Suit> countsBySuit() { return null; } 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(); }
@Test public void hearts() { Assert.assertEquals(this.jdk1Deck.hearts(), this.jdk2Deck.hearts()); }
public List<Card> hearts() { return null; }
JDK8DeckOfCardsAsList { public List<Card> hearts() { return null; } }
JDK8DeckOfCardsAsList { public List<Card> hearts() { return null; } JDK8DeckOfCardsAsList(); }
JDK8DeckOfCardsAsList { public List<Card> hearts() { return null; } JDK8DeckOfCardsAsList(); 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(); }
JDK8DeckOfCardsAsList { public List<Card> hearts() { return null; } JDK8DeckOfCardsAsList(); 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(); }
@Test public void countsByRank() { Assert.assertEquals( this.jdkDeck.countsByRank().get(Rank.TEN).intValue(), this.acDeck.countsByRank().getCount(Rank.EIGHT)); }
public MultiSet<Rank> countsByRank() { return null; }
ApacheCommonsDeckOfCardsAsSortedSet { public MultiSet<Rank> countsByRank() { return null; } }
ApacheCommonsDeckOfCardsAsSortedSet { public MultiSet<Rank> countsByRank() { return null; } ApacheCommonsDeckOfCardsAsSortedSet(); }
ApacheCommonsDeckOfCardsAsSortedSet { public MultiSet<Rank> countsByRank() { return null; } 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(); }
ApacheCommonsDeckOfCardsAsSortedSet { public MultiSet<Rank> countsByRank() { return null; } 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(); }
@Test public void allCards() { Assert.assertEquals(this.jdkDeck.getCards(), this.ggDeck.getCards()); }
public ImmutableSortedSet<Card> getCards() { return this.cards; }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } GoogleGuavaDeckOfCardsAsSortedSet(); }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void cardsAreImmutable() { var ggCards = this.ggDeck.getCards(); Verify.assertThrows( UnsupportedOperationException.class, () -> ggCards.remove(null)); Verify.assertThrows( UnsupportedOperationException.class, ggCards::clear); Verify.assertThrows( UnsupportedOperationException.class, () -> ggCards.add(null)); }
public ImmutableSortedSet<Card> getCards() { return this.cards; }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } GoogleGuavaDeckOfCardsAsSortedSet(); }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void diamonds() { Assert.assertEquals(this.jdkDeck.diamonds(), this.ggDeck.diamonds()); }
public Set<Card> diamonds() { return null; }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> diamonds() { return null; } }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> diamonds() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> diamonds() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> diamonds() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void hearts() { Assert.assertEquals(this.jdkDeck.hearts(), this.ggDeck.hearts()); }
public Set<Card> hearts() { return null; }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> hearts() { return null; } }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> hearts() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> hearts() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> hearts() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void spades() { Assert.assertEquals(this.jdkDeck.spades(), this.ggDeck.spades()); }
public Set<Card> spades() { return null; }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> spades() { return null; } }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> spades() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> spades() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> spades() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void clubs() { Assert.assertEquals(this.jdkDeck.clubs(), this.ggDeck.clubs()); }
public Set<Card> clubs() { return null; }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> clubs() { return null; } }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> clubs() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> clubs() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
GoogleGuavaDeckOfCardsAsSortedSet { public Set<Card> clubs() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void deal() { Deque<Card> jdkShuffle = this.jdkDeck.shuffle(new Random(1)); Deque<Card> ggShuffle = this.ggDeck.shuffle(new Random(1)); Set<Card> jdkHand = this.jdkDeck.deal(jdkShuffle, 5); Set<Card> ggHand = this.ggDeck.deal(ggShuffle, 5); Assert.assertEquals(jdkHand, ggHand); }
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; }
GoogleGuavaDeckOfCardsAsSortedSet { 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; } }
GoogleGuavaDeckOfCardsAsSortedSet { 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; } GoogleGuavaDeckOfCardsAsSortedSet(); }
GoogleGuavaDeckOfCardsAsSortedSet { 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; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
GoogleGuavaDeckOfCardsAsSortedSet { 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; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void shuffleAndDealHands() { List<Set<Card>> jdkHands = this.jdkDeck.shuffleAndDeal(new Random(1), 5, 5); List<Set<Card>> ggHands = this.ggDeck.shuffleAndDeal(new Random(1), 5, 5); Assert.assertEquals(jdkHands, ggHands); }
public ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } GoogleGuavaDeckOfCardsAsSortedSet(); }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void dealHands() { Deque<Card> jdkShuffled = this.jdkDeck.shuffle(new Random(1)); Deque<Card> ggShuffled = this.ggDeck.shuffle(new Random(1)); List<Set<Card>> jdkHands = this.jdkDeck.dealHands(jdkShuffled, 5, 5); List<Set<Card>> ggHands = this.ggDeck.dealHands(ggShuffled, 5, 5); Assert.assertEquals(jdkHands, ggHands); }
public ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void spades() { Assert.assertEquals(this.jdk1Deck.spades(), this.jdk2Deck.spades()); }
public List<Card> spades() { return null; }
JDK8DeckOfCardsAsList { public List<Card> spades() { return null; } }
JDK8DeckOfCardsAsList { public List<Card> spades() { return null; } JDK8DeckOfCardsAsList(); }
JDK8DeckOfCardsAsList { public List<Card> spades() { return null; } JDK8DeckOfCardsAsList(); 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(); }
JDK8DeckOfCardsAsList { public List<Card> spades() { return null; } JDK8DeckOfCardsAsList(); 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(); }
@Test public void cardsBySuit() { Map<Suit, SortedSet<Card>> jdkCardsBySuit = this.jdkDeck.getCardsBySuit(); ImmutableSetMultimap<Suit, Card> ggCardsBySuit = this.ggDeck.getCardsBySuit(); Assert.assertEquals(jdkCardsBySuit.get(Suit.CLUBS), ggCardsBySuit.get(Suit.CLUBS)); }
public ImmutableSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } GoogleGuavaDeckOfCardsAsSortedSet(); }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void cardsBySuitIsImmutable() { var ggCardsBySuit = this.ggDeck.getCardsBySuit(); Verify.assertThrows( UnsupportedOperationException.class, () -> ggCardsBySuit.removeAll(Suit.CLUBS)); Verify.assertThrows( UnsupportedOperationException.class, ggCardsBySuit::clear); Verify.assertThrows( UnsupportedOperationException.class, () -> ggCardsBySuit.get(Suit.CLUBS).remove(null)); Verify.assertThrows( UnsupportedOperationException.class, () -> ggCardsBySuit.get(Suit.CLUBS).add(null)); Verify.assertThrows( UnsupportedOperationException.class, ggCardsBySuit.get(Suit.CLUBS)::clear); }
public ImmutableSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } GoogleGuavaDeckOfCardsAsSortedSet(); }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
GoogleGuavaDeckOfCardsAsSortedSet { public ImmutableSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void countsBySuit() { Assert.assertEquals( this.jdkDeck.countsBySuit().get(Suit.CLUBS).intValue(), this.ggDeck.countsBySuit().count(Suit.CLUBS)); }
public Multiset<Suit> countsBySuit() { return null; }
GoogleGuavaDeckOfCardsAsSortedSet { public Multiset<Suit> countsBySuit() { return null; } }
GoogleGuavaDeckOfCardsAsSortedSet { public Multiset<Suit> countsBySuit() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); }
GoogleGuavaDeckOfCardsAsSortedSet { public Multiset<Suit> countsBySuit() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
GoogleGuavaDeckOfCardsAsSortedSet { public Multiset<Suit> countsBySuit() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void countsByRank() { Assert.assertEquals( this.jdkDeck.countsByRank().get(Rank.TEN).intValue(), this.ggDeck.countsByRank().count(Rank.NINE)); }
public Multiset<Rank> countsByRank() { return null; }
GoogleGuavaDeckOfCardsAsSortedSet { public Multiset<Rank> countsByRank() { return null; } }
GoogleGuavaDeckOfCardsAsSortedSet { public Multiset<Rank> countsByRank() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); }
GoogleGuavaDeckOfCardsAsSortedSet { public Multiset<Rank> countsByRank() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
GoogleGuavaDeckOfCardsAsSortedSet { public Multiset<Rank> countsByRank() { return null; } GoogleGuavaDeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( Deque<Card> shuffled, int hands, int cardsPerHand); Set<Card> diamonds(); Set<Card> hearts(); Set<Card> spades(); Set<Card> clubs(); Multiset<Suit> countsBySuit(); Multiset<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void allCards() { Assert.assertEquals(this.ecDeck.getCards(), this.jdkDeck.getCards()); }
public ImmutableSortedSet<Card> getCards() { return this.cards; }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsSortedSet(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void cardsAreImmutable() { var ecCards = this.ecDeck.getCards().castToSortedSet(); Verify.assertThrows( UnsupportedOperationException.class, () -> ecCards.remove(null)); Verify.assertThrows( UnsupportedOperationException.class, ecCards::clear); Verify.assertThrows( UnsupportedOperationException.class, () -> ecCards.add(null)); }
public ImmutableSortedSet<Card> getCards() { return this.cards; }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsSortedSet(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void diamonds() { Assert.assertEquals(this.ecDeck.diamonds(), this.jdkDeck.diamonds()); }
public ImmutableSortedSet<Card> diamonds() { return null; }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> diamonds() { return null; } }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> diamonds() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> diamonds() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> diamonds() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void hearts() { Assert.assertEquals(this.ecDeck.hearts(), this.jdkDeck.hearts()); }
public ImmutableSortedSet<Card> hearts() { return null; }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> hearts() { return null; } }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> hearts() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> hearts() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> hearts() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void spades() { Assert.assertEquals(this.ecDeck.spades(), this.jdkDeck.spades()); }
public ImmutableSortedSet<Card> spades() { return null; }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> spades() { return null; } }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> spades() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> spades() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> spades() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void clubs() { Assert.assertEquals(this.ecDeck.clubs(), this.jdkDeck.clubs()); }
public ImmutableSortedSet<Card> clubs() { return null; }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> clubs() { return null; } }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> clubs() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> clubs() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSet<Card> clubs() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void clubs() { Assert.assertEquals(this.jdk1Deck.clubs(), this.jdk2Deck.clubs()); }
public List<Card> clubs() { return null; }
JDK8DeckOfCardsAsList { public List<Card> clubs() { return null; } }
JDK8DeckOfCardsAsList { public List<Card> clubs() { return null; } JDK8DeckOfCardsAsList(); }
JDK8DeckOfCardsAsList { public List<Card> clubs() { return null; } JDK8DeckOfCardsAsList(); 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(); }
JDK8DeckOfCardsAsList { public List<Card> clubs() { return null; } JDK8DeckOfCardsAsList(); 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(); }
@Test public void deal() { MutableStack<Card> ecShuffle = this.ecDeck.shuffle(new Random(1)); Deque<Card> jdkShuffle = this.jdkDeck.shuffle(new Random(1)); MutableSet<Card> ecHand = this.ecDeck.deal(ecShuffle, 5); Set<Card> jdkHand = this.jdkDeck.deal(jdkShuffle, 5); Assert.assertEquals(ecHand, jdkHand); }
public MutableSet<Card> deal(MutableStack<Card> stack, int count) { return stack.pop(count).toSet(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public MutableSet<Card> deal(MutableStack<Card> stack, int count) { return stack.pop(count).toSet(); } }
EclipseCollectionsDeckOfCardsAsSortedSet { public MutableSet<Card> deal(MutableStack<Card> stack, int count) { return stack.pop(count).toSet(); } EclipseCollectionsDeckOfCardsAsSortedSet(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public MutableSet<Card> deal(MutableStack<Card> stack, int count) { return stack.pop(count).toSet(); } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public MutableSet<Card> deal(MutableStack<Card> stack, int count) { return stack.pop(count).toSet(); } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void shuffleAndDealHands() { ImmutableList<Set<Card>> ecHands = this.ecDeck.shuffleAndDeal(new Random(1), 5, 5); List<Set<Card>> jdkHands = this.jdkDeck.shuffleAndDeal(new Random(1), 5, 5); Assert.assertEquals(ecHands, jdkHands); }
public ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { MutableStack<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { MutableStack<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { MutableStack<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } EclipseCollectionsDeckOfCardsAsSortedSet(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { MutableStack<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { MutableStack<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void dealHands() { MutableStack<Card> ecShuffled = this.ecDeck.shuffle(new Random(1)); Deque<Card> jdkShuffled = this.jdkDeck.shuffle(new Random(1)); ImmutableList<Set<Card>> ecHands = this.ecDeck.dealHands(ecShuffled, 5, 5); List<Set<Card>> jdkHands = this.jdkDeck.dealHands(jdkShuffled, 5, 5); Assert.assertEquals(ecHands, jdkHands); }
public ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand) { return null; }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand) { return null; } }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand) { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand) { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand) { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void cardsBySuit() { ImmutableSortedSetMultimap<Suit, Card> ecCardsBySuit = this.ecDeck.getCardsBySuit(); Map<Suit, SortedSet<Card>> jdkCardsBySuit = this.jdkDeck.getCardsBySuit(); Assert.assertEquals(ecCardsBySuit.get(Suit.CLUBS), jdkCardsBySuit.get(Suit.CLUBS)); }
public ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } EclipseCollectionsDeckOfCardsAsSortedSet(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void cardsBySuitIsImmutable() { var ecCardsBySuit = this.ecDeck.getCardsBySuit(); Verify.assertThrows( UnsupportedOperationException.class, () -> ecCardsBySuit.get(Suit.CLUBS).castToSortedSet().remove(null)); Verify.assertThrows( UnsupportedOperationException.class, () -> ecCardsBySuit.get(Suit.CLUBS).castToSortedSet().add(null)); Verify.assertThrows( UnsupportedOperationException.class, ecCardsBySuit.get(Suit.CLUBS).castToSortedSet()::clear); }
public ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } EclipseCollectionsDeckOfCardsAsSortedSet(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void countsBySuit() { Assert.assertEquals( this.jdkDeck.countsBySuit().get(Suit.CLUBS).intValue(), this.ecDeck.countsBySuit().occurrencesOf(Suit.CLUBS)); }
public Bag<Suit> countsBySuit() { return null; }
EclipseCollectionsDeckOfCardsAsSortedSet { public Bag<Suit> countsBySuit() { return null; } }
EclipseCollectionsDeckOfCardsAsSortedSet { public Bag<Suit> countsBySuit() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public Bag<Suit> countsBySuit() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public Bag<Suit> countsBySuit() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void countsByRank() { Assert.assertEquals( this.jdkDeck.countsByRank().get(Rank.TEN).intValue(), this.ecDeck.countsByRank().occurrencesOf(Rank.SEVEN)); }
public Bag<Rank> countsByRank() { return null; }
EclipseCollectionsDeckOfCardsAsSortedSet { public Bag<Rank> countsByRank() { return null; } }
EclipseCollectionsDeckOfCardsAsSortedSet { public Bag<Rank> countsByRank() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public Bag<Rank> countsByRank() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsSortedSet { public Bag<Rank> countsByRank() { return null; } EclipseCollectionsDeckOfCardsAsSortedSet(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableSortedSet<Card> diamonds(); ImmutableSortedSet<Card> hearts(); ImmutableSortedSet<Card> spades(); ImmutableSortedSet<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableSortedSet<Card> getCards(); ImmutableSortedSetMultimap<Suit, Card> getCardsBySuit(); }
@Test public void allCards() { Assert.assertEquals(52, this.jdkDeck.getCards().size()); Assert.assertEquals(new Card(Rank.ACE, Suit.SPADES), this.jdkDeck.getCards().first()); Assert.assertEquals(new Card(Rank.KING, Suit.CLUBS), this.jdkDeck.getCards().last()); }
public SortedSet<Card> getCards() { return this.cards; }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } JDKImperativeDeckOfCardsAsSortedSet(); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
@Test public void cardsAreImmutable() { var jdkCards = this.jdkDeck.getCards(); Verify.assertThrows( UnsupportedOperationException.class, () -> jdkCards.remove(null)); Verify.assertThrows( UnsupportedOperationException.class, jdkCards::clear); Verify.assertThrows( UnsupportedOperationException.class, () -> jdkCards.add(null)); }
public SortedSet<Card> getCards() { return this.cards; }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } JDKImperativeDeckOfCardsAsSortedSet(); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
@Test public void diamonds() { Assert.assertEquals(13, this.jdkDeck.diamonds().size()); Assert.assertTrue(Iterate.allSatisfy(this.jdkDeck.diamonds(), Card::isDiamonds)); }
public SortedSet<Card> diamonds() { return this.cardsBySuit.get(Suit.DIAMONDS); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return this.cardsBySuit.get(Suit.DIAMONDS); } }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return this.cardsBySuit.get(Suit.DIAMONDS); } JDKImperativeDeckOfCardsAsSortedSet(); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return this.cardsBySuit.get(Suit.DIAMONDS); } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return this.cardsBySuit.get(Suit.DIAMONDS); } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
@Test public void deal() { var jdk1Shuffle = this.jdk1Deck.shuffle(new Random(1)); var jdk2Shuffle = this.jdk2Deck.shuffle(new Random(1)); var jdk1Hand = this.jdk1Deck.deal(jdk1Shuffle, 5); var jdk2Hand = this.jdk2Deck.deal(jdk2Shuffle, 5); Assert.assertEquals(jdk1Hand, jdk2Hand); }
public Set<Card> deal(Deque<Card> deque, int count) { var hand = new HashSet<Card>(); IntStream.range(0, count).forEach(i -> hand.add(deque.pop())); return hand; }
JDK8DeckOfCardsAsList { public Set<Card> deal(Deque<Card> deque, int count) { var hand = new HashSet<Card>(); IntStream.range(0, count).forEach(i -> hand.add(deque.pop())); return hand; } }
JDK8DeckOfCardsAsList { public Set<Card> deal(Deque<Card> deque, int count) { var hand = new HashSet<Card>(); IntStream.range(0, count).forEach(i -> hand.add(deque.pop())); return hand; } JDK8DeckOfCardsAsList(); }
JDK8DeckOfCardsAsList { public Set<Card> deal(Deque<Card> deque, int count) { var hand = new HashSet<Card>(); IntStream.range(0, count).forEach(i -> hand.add(deque.pop())); return hand; } JDK8DeckOfCardsAsList(); 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(); }
JDK8DeckOfCardsAsList { public Set<Card> deal(Deque<Card> deque, int count) { var hand = new HashSet<Card>(); IntStream.range(0, count).forEach(i -> hand.add(deque.pop())); return hand; } JDK8DeckOfCardsAsList(); 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(); }
@Test public void cardsAreImmutable() { var ecCards = this.ecDeck.getCards().castToList(); Verify.assertThrows( UnsupportedOperationException.class, () -> ecCards.remove(0)); Verify.assertThrows( UnsupportedOperationException.class, ecCards::clear); Verify.assertThrows( UnsupportedOperationException.class, () -> ecCards.add(null)); }
public ImmutableList<Card> getCards() { return this.cards; }
EclipseCollectionsDeckOfCardsAsList { public ImmutableList<Card> getCards() { return this.cards; } }
EclipseCollectionsDeckOfCardsAsList { public ImmutableList<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsList(); }
EclipseCollectionsDeckOfCardsAsList { public ImmutableList<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsList(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableList<Card> diamonds(); ImmutableList<Card> hearts(); ImmutableList<Card> spades(); ImmutableList<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableList<Card> getCards(); ImmutableListMultimap<Suit, Card> getCardsBySuit(); }
EclipseCollectionsDeckOfCardsAsList { public ImmutableList<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsList(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); ImmutableList<Set<Card>> dealHands( MutableStack<Card> shuffled, int hands, int cardsPerHand); ImmutableList<Card> diamonds(); ImmutableList<Card> hearts(); ImmutableList<Card> spades(); ImmutableList<Card> clubs(); Bag<Suit> countsBySuit(); Bag<Rank> countsByRank(); ImmutableList<Card> getCards(); ImmutableListMultimap<Suit, Card> getCardsBySuit(); }
@Test public void hearts() { Assert.assertEquals(13, this.jdkDeck.hearts().size()); Assert.assertTrue(Iterate.allSatisfy(this.jdkDeck.hearts(), Card::isHearts)); }
public SortedSet<Card> hearts() { return this.cardsBySuit.get(Suit.HEARTS); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return this.cardsBySuit.get(Suit.HEARTS); } }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return this.cardsBySuit.get(Suit.HEARTS); } JDKImperativeDeckOfCardsAsSortedSet(); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return this.cardsBySuit.get(Suit.HEARTS); } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return this.cardsBySuit.get(Suit.HEARTS); } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
@Test public void spades() { Assert.assertEquals(13, this.jdkDeck.spades().size()); Assert.assertTrue(Iterate.allSatisfy(this.jdkDeck.spades(), Card::isSpades)); }
public SortedSet<Card> spades() { return this.cardsBySuit.get(Suit.SPADES); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return this.cardsBySuit.get(Suit.SPADES); } }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return this.cardsBySuit.get(Suit.SPADES); } JDKImperativeDeckOfCardsAsSortedSet(); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return this.cardsBySuit.get(Suit.SPADES); } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return this.cardsBySuit.get(Suit.SPADES); } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
@Test public void clubs() { Assert.assertEquals(13, this.jdkDeck.clubs().size()); Assert.assertTrue(Iterate.allSatisfy(this.jdkDeck.clubs(), Card::isClubs)); }
public SortedSet<Card> clubs() { return this.cardsBySuit.get(Suit.CLUBS); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return this.cardsBySuit.get(Suit.CLUBS); } }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return this.cardsBySuit.get(Suit.CLUBS); } JDKImperativeDeckOfCardsAsSortedSet(); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return this.cardsBySuit.get(Suit.CLUBS); } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
JDKImperativeDeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return this.cardsBySuit.get(Suit.CLUBS); } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
@Test public void deal() { Deque<Card> jdkShuffle = this.jdkDeck.shuffle(new Random(1)); Set<Card> jdkHand = this.jdkDeck.deal(jdkShuffle, 5); Assert.assertEquals(5, jdkHand.size()); Assert.assertEquals(47, jdkShuffle.size()); }
public Set<Card> deal(Deque<Card> deque, int count) { Set<Card> hand = new HashSet<>(); for (int i = 0; i < count; i++) { hand.add(deque.pop()); } return hand; }
JDKImperativeDeckOfCardsAsSortedSet { public Set<Card> deal(Deque<Card> deque, int count) { Set<Card> hand = new HashSet<>(); for (int i = 0; i < count; i++) { hand.add(deque.pop()); } return hand; } }
JDKImperativeDeckOfCardsAsSortedSet { public Set<Card> deal(Deque<Card> deque, int count) { Set<Card> hand = new HashSet<>(); for (int i = 0; i < count; i++) { hand.add(deque.pop()); } return hand; } JDKImperativeDeckOfCardsAsSortedSet(); }
JDKImperativeDeckOfCardsAsSortedSet { public Set<Card> deal(Deque<Card> deque, int count) { Set<Card> hand = new HashSet<>(); for (int i = 0; i < count; i++) { hand.add(deque.pop()); } return hand; } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
JDKImperativeDeckOfCardsAsSortedSet { public Set<Card> deal(Deque<Card> deque, int count) { Set<Card> hand = new HashSet<>(); for (int i = 0; i < count; i++) { hand.add(deque.pop()); } return hand; } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
@Test public void shuffleAndDealHands() { List<Set<Card>> jdkHands = this.jdkDeck.shuffleAndDeal(new Random(1), 5, 5); Assert.assertEquals(5, jdkHands.size()); Assert.assertTrue(Iterate.allSatisfy(jdkHands, each -> each.size() == 5)); }
public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); }
JDKImperativeDeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } }
JDKImperativeDeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } JDKImperativeDeckOfCardsAsSortedSet(); }
JDKImperativeDeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
JDKImperativeDeckOfCardsAsSortedSet { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { Deque<Card> shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
@Test public void dealHands() { Deque<Card> jdkShuffled = this.jdkDeck.shuffle(new Random(1)); List<Set<Card>> jdkHands = this.jdkDeck.dealHands(jdkShuffled, 5, 5); Assert.assertEquals(5, jdkHands.size()); Assert.assertTrue(Iterate.allSatisfy(jdkHands, each -> each.size() == 5)); Assert.assertEquals(27, jdkShuffled.size()); }
public List<Set<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { List<Set<Card>> result = new ArrayList<>(); for (int i = 0; i < hands; i++) { result.add(this.deal(shuffled, cardsPerHand)); } return Collections.unmodifiableList(result); }
JDKImperativeDeckOfCardsAsSortedSet { public List<Set<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { List<Set<Card>> result = new ArrayList<>(); for (int i = 0; i < hands; i++) { result.add(this.deal(shuffled, cardsPerHand)); } return Collections.unmodifiableList(result); } }
JDKImperativeDeckOfCardsAsSortedSet { public List<Set<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { List<Set<Card>> result = new ArrayList<>(); for (int i = 0; i < hands; i++) { result.add(this.deal(shuffled, cardsPerHand)); } return Collections.unmodifiableList(result); } JDKImperativeDeckOfCardsAsSortedSet(); }
JDKImperativeDeckOfCardsAsSortedSet { public List<Set<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { List<Set<Card>> result = new ArrayList<>(); for (int i = 0; i < hands; i++) { result.add(this.deal(shuffled, cardsPerHand)); } return Collections.unmodifiableList(result); } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
JDKImperativeDeckOfCardsAsSortedSet { public List<Set<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { List<Set<Card>> result = new ArrayList<>(); for (int i = 0; i < hands; i++) { result.add(this.deal(shuffled, cardsPerHand)); } return Collections.unmodifiableList(result); } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
@Test public void cardsBySuit() { Map<Suit, SortedSet<Card>> jdkCardsBySuit = this.jdkDeck.getCardsBySuit(); Assert.assertEquals(4, jdkCardsBySuit.size()); Assert.assertEquals(13, jdkCardsBySuit.get(Suit.CLUBS).size()); Assert.assertEquals(13, jdkCardsBySuit.get(Suit.DIAMONDS).size()); Assert.assertEquals(13, jdkCardsBySuit.get(Suit.SPADES).size()); Assert.assertEquals(13, jdkCardsBySuit.get(Suit.HEARTS).size()); }
public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } JDKImperativeDeckOfCardsAsSortedSet(); }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
@Test public void cardsBySuitIsImmutable() { var jdkCardsBySuit = this.jdkDeck.getCardsBySuit(); Verify.assertThrows( UnsupportedOperationException.class, () -> jdkCardsBySuit.remove(Suit.CLUBS)); Verify.assertThrows( UnsupportedOperationException.class, jdkCardsBySuit::clear); Verify.assertThrows( UnsupportedOperationException.class, () -> jdkCardsBySuit.get(Suit.CLUBS).remove(null)); Verify.assertThrows( UnsupportedOperationException.class, () -> jdkCardsBySuit.get(Suit.CLUBS).add(null)); Verify.assertThrows( UnsupportedOperationException.class, jdkCardsBySuit.get(Suit.CLUBS)::clear); }
public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } JDKImperativeDeckOfCardsAsSortedSet(); }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Suit, SortedSet<Card>> getCardsBySuit() { return this.cardsBySuit; } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
@Test public void countsBySuit() { Assert.assertEquals(Long.valueOf(13), this.jdkDeck.countsBySuit().get(Suit.CLUBS)); }
public Map<Suit, Long> countsBySuit() { Map<Suit, Long> result = new HashMap<>(); for (Card card : this.cards) { Suit suit = card.suit(); Long value = result.get(suit); if (value == null) { value = Long.valueOf(0); } result.put(suit, value + 1); } return result; }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Suit, Long> countsBySuit() { Map<Suit, Long> result = new HashMap<>(); for (Card card : this.cards) { Suit suit = card.suit(); Long value = result.get(suit); if (value == null) { value = Long.valueOf(0); } result.put(suit, value + 1); } return result; } }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Suit, Long> countsBySuit() { Map<Suit, Long> result = new HashMap<>(); for (Card card : this.cards) { Suit suit = card.suit(); Long value = result.get(suit); if (value == null) { value = Long.valueOf(0); } result.put(suit, value + 1); } return result; } JDKImperativeDeckOfCardsAsSortedSet(); }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Suit, Long> countsBySuit() { Map<Suit, Long> result = new HashMap<>(); for (Card card : this.cards) { Suit suit = card.suit(); Long value = result.get(suit); if (value == null) { value = Long.valueOf(0); } result.put(suit, value + 1); } return result; } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Suit, Long> countsBySuit() { Map<Suit, Long> result = new HashMap<>(); for (Card card : this.cards) { Suit suit = card.suit(); Long value = result.get(suit); if (value == null) { value = Long.valueOf(0); } result.put(suit, value + 1); } return result; } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
@Test public void countsByRank() { Assert.assertEquals(Long.valueOf(4), this.jdkDeck.countsByRank().get(Rank.TEN)); }
public Map<Rank, Long> countsByRank() { Map<Rank, Long> result = new HashMap<>(); for (Card card : this.cards) { Rank rank = card.rank(); Long value = result.get(rank); if (value == null) { value = Long.valueOf(0); } result.put(rank, value + 1); } return result; }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Rank, Long> countsByRank() { Map<Rank, Long> result = new HashMap<>(); for (Card card : this.cards) { Rank rank = card.rank(); Long value = result.get(rank); if (value == null) { value = Long.valueOf(0); } result.put(rank, value + 1); } return result; } }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Rank, Long> countsByRank() { Map<Rank, Long> result = new HashMap<>(); for (Card card : this.cards) { Rank rank = card.rank(); Long value = result.get(rank); if (value == null) { value = Long.valueOf(0); } result.put(rank, value + 1); } return result; } JDKImperativeDeckOfCardsAsSortedSet(); }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Rank, Long> countsByRank() { Map<Rank, Long> result = new HashMap<>(); for (Card card : this.cards) { Rank rank = card.rank(); Long value = result.get(rank); if (value == null) { value = Long.valueOf(0); } result.put(rank, value + 1); } return result; } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
JDKImperativeDeckOfCardsAsSortedSet { public Map<Rank, Long> countsByRank() { Map<Rank, Long> result = new HashMap<>(); for (Card card : this.cards) { Rank rank = card.rank(); Long value = result.get(rank); if (value == null) { value = Long.valueOf(0); } result.put(rank, value + 1); } return result; } JDKImperativeDeckOfCardsAsSortedSet(); 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(); }
@Test public void shuffleAndDealHands() { var jdk1Hands = this.jdk1Deck.shuffleAndDeal(new Random(1), 5, 5); var jdk2Hands = this.jdk2Deck.shuffleAndDeal(new Random(1), 5, 5); Assert.assertEquals(jdk1Hands, jdk2Hands); }
public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { var shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); }
JDK8DeckOfCardsAsList { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { var shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } }
JDK8DeckOfCardsAsList { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { var shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } JDK8DeckOfCardsAsList(); }
JDK8DeckOfCardsAsList { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { var shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } JDK8DeckOfCardsAsList(); 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(); }
JDK8DeckOfCardsAsList { public List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand) { var shuffled = this.shuffle(random); return this.dealHands(shuffled, hands, cardsPerHand); } JDK8DeckOfCardsAsList(); 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(); }
@Test public void getTop2Donuts() { var expected = Lists.mutable.empty() .with(pair(DonutType.BOSTON_CREAM, 15)) .with(pair(DonutType.GLAZED, 11)); Assert.assertEquals(expected, this.donutShop.getTopDonuts(2)); }
public MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n) { return this.deliveries .flatCollect(Delivery::donuts) .countBy(Donut::type) .topOccurrences(n); }
DonutShop { public MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n) { return this.deliveries .flatCollect(Delivery::donuts) .countBy(Donut::type) .topOccurrences(n); } }
DonutShop { public MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n) { return this.deliveries .flatCollect(Delivery::donuts) .countBy(Donut::type) .topOccurrences(n); } }
DonutShop { public MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n) { return this.deliveries .flatCollect(Delivery::donuts) .countBy(Donut::type) .topOccurrences(n); } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
DonutShop { public MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n) { return this.deliveries .flatCollect(Delivery::donuts) .countBy(Donut::type) .topOccurrences(n); } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
@Test public void totalDeliveryValueByDate() { Assert.assertEquals( 9.45d, this.donutShop.getTotalDeliveryValueFor(this.today), 0.001); Assert.assertEquals( 12.0d, this.donutShop.getTotalDeliveryValueFor(this.tomorrow), 0.001); Assert.assertEquals( 20.9d, this.donutShop.getTotalDeliveryValueFor(this.yesterday), 0.001); }
public double getTotalDeliveryValueFor(LocalDate date) { return this.deliveries .selectWith(Delivery::deliveredOn, date) .sumOfDouble(Delivery::getTotalPrice); }
DonutShop { public double getTotalDeliveryValueFor(LocalDate date) { return this.deliveries .selectWith(Delivery::deliveredOn, date) .sumOfDouble(Delivery::getTotalPrice); } }
DonutShop { public double getTotalDeliveryValueFor(LocalDate date) { return this.deliveries .selectWith(Delivery::deliveredOn, date) .sumOfDouble(Delivery::getTotalPrice); } }
DonutShop { public double getTotalDeliveryValueFor(LocalDate date) { return this.deliveries .selectWith(Delivery::deliveredOn, date) .sumOfDouble(Delivery::getTotalPrice); } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
DonutShop { public double getTotalDeliveryValueFor(LocalDate date) { return this.deliveries .selectWith(Delivery::deliveredOn, date) .sumOfDouble(Delivery::getTotalPrice); } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
@Test public void getTopCustomer() { Assert.assertEquals("Donnie Dapper", this.donutShop.getTopCustomer().name()); }
public Customer getTopCustomer() { return this.customers.maxBy(Customer::getTotalDonutsOrdered); }
DonutShop { public Customer getTopCustomer() { return this.customers.maxBy(Customer::getTotalDonutsOrdered); } }
DonutShop { public Customer getTopCustomer() { return this.customers.maxBy(Customer::getTotalDonutsOrdered); } }
DonutShop { public Customer getTopCustomer() { return this.customers.maxBy(Customer::getTotalDonutsOrdered); } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
DonutShop { public Customer getTopCustomer() { return this.customers.maxBy(Customer::getTotalDonutsOrdered); } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
@Test public void getCustomersByDonutTypesOrdered() { var multimap = this.donutShop.getCustomersByDonutTypesOrdered(); Assert.assertEquals(6, multimap.keySet().size()); Verify.assertIterableSize(1, multimap.get(DonutType.BAVARIAN_CREAM)); Verify.assertAllSatisfy( multimap.get(DonutType.BAVARIAN_CREAM), customer -> customer.named("Ted Smith")); }
public Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered() { return this.customers.groupByEach(Customer::getDonutTypesOrdered); }
DonutShop { public Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered() { return this.customers.groupByEach(Customer::getDonutTypesOrdered); } }
DonutShop { public Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered() { return this.customers.groupByEach(Customer::getDonutTypesOrdered); } }
DonutShop { public Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered() { return this.customers.groupByEach(Customer::getDonutTypesOrdered); } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
DonutShop { public Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered() { return this.customers.groupByEach(Customer::getDonutTypesOrdered); } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
@Test public void getDonutPriceStatistics() { var stats1 = this.donutShop.getDonutPriceStatistics(this.today, this.today); Assert.assertEquals(9.45d, stats1.getSum(), 0.01); Assert.assertEquals(1.35d, stats1.getAverage(), 0.01); Assert.assertEquals(7, stats1.getCount(), 0.01); var stats2 = this.donutShop.getDonutPriceStatistics(this.tomorrow, this.tomorrow); Assert.assertEquals(12.0d, stats2.getSum(), 0.01); Assert.assertEquals(1.0d, stats2.getAverage(), 0.01); Assert.assertEquals(12, stats2.getCount(), 0.01); var stats3 = this.donutShop.getDonutPriceStatistics(this.yesterday, this.yesterday); Assert.assertEquals(20.9d, stats3.getSum(), 0.001); Assert.assertEquals(0.95d, stats3.getAverage(), 0.01); Assert.assertEquals(22, stats3.getCount(), 0.01); var statsTotal = this.donutShop.getDonutPriceStatistics(this.yesterday, this.tomorrow); Assert.assertEquals(42.35d, statsTotal.getSum(), 0.01); Assert.assertEquals(1.03d, statsTotal.getAverage(), 0.01); Assert.assertEquals(41, statsTotal.getCount(), 0.01); Assert.assertEquals(0.95, statsTotal.getMin(), 0.01); Assert.assertEquals(1.35, statsTotal.getMax(), 0.01); }
public DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate) { return this.deliveries .select(each -> (each.deliveredOn(fromDate) || each.getDate().isAfter(fromDate))) .select(each -> (each.deliveredOn(toDate) || each.getDate().isBefore(toDate))) .flatCollect(Delivery::donuts) .summarizeDouble(Donut::price); }
DonutShop { public DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate) { return this.deliveries .select(each -> (each.deliveredOn(fromDate) || each.getDate().isAfter(fromDate))) .select(each -> (each.deliveredOn(toDate) || each.getDate().isBefore(toDate))) .flatCollect(Delivery::donuts) .summarizeDouble(Donut::price); } }
DonutShop { public DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate) { return this.deliveries .select(each -> (each.deliveredOn(fromDate) || each.getDate().isAfter(fromDate))) .select(each -> (each.deliveredOn(toDate) || each.getDate().isBefore(toDate))) .flatCollect(Delivery::donuts) .summarizeDouble(Donut::price); } }
DonutShop { public DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate) { return this.deliveries .select(each -> (each.deliveredOn(fromDate) || each.getDate().isAfter(fromDate))) .select(each -> (each.deliveredOn(toDate) || each.getDate().isBefore(toDate))) .flatCollect(Delivery::donuts) .summarizeDouble(Donut::price); } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
DonutShop { public DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate) { return this.deliveries .select(each -> (each.deliveredOn(fromDate) || each.getDate().isAfter(fromDate))) .select(each -> (each.deliveredOn(toDate) || each.getDate().isBefore(toDate))) .flatCollect(Delivery::donuts) .summarizeDouble(Donut::price); } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
@Test public void getTop2Donuts() { var expected = Lists.mutable.empty() .with(pair(DonutType.BOSTON_CREAM, 15)) .with(pair(DonutType.GLAZED, 11)); Assert.assertEquals(expected, this.donutShop.getTopDonuts(2)); }
public MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n) { return null; }
DonutShop { public MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n) { return null; } }
DonutShop { public MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n) { return null; } }
DonutShop { public MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n) { return null; } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
DonutShop { public MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n) { return null; } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
@Test public void totalDeliveryValueByDate() { Assert.assertEquals( 9.45d, this.donutShop.getTotalDeliveryValueFor(this.today), 0.001); Assert.assertEquals( 12.0d, this.donutShop.getTotalDeliveryValueFor(this.tomorrow), 0.001); Assert.assertEquals( 20.9d, this.donutShop.getTotalDeliveryValueFor(this.yesterday), 0.001); }
public double getTotalDeliveryValueFor(LocalDate date) { return 0.0d; }
DonutShop { public double getTotalDeliveryValueFor(LocalDate date) { return 0.0d; } }
DonutShop { public double getTotalDeliveryValueFor(LocalDate date) { return 0.0d; } }
DonutShop { public double getTotalDeliveryValueFor(LocalDate date) { return 0.0d; } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
DonutShop { public double getTotalDeliveryValueFor(LocalDate date) { return 0.0d; } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
@Test public void getTopCustomer() { Assert.assertEquals("Donnie Dapper", this.donutShop.getTopCustomer().name()); }
public Customer getTopCustomer() { return null; }
DonutShop { public Customer getTopCustomer() { return null; } }
DonutShop { public Customer getTopCustomer() { return null; } }
DonutShop { public Customer getTopCustomer() { return null; } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
DonutShop { public Customer getTopCustomer() { return null; } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
@Test public void getCustomersByDonutTypesOrdered() { var multimap = this.donutShop.getCustomersByDonutTypesOrdered(); Assert.assertEquals(6, multimap.keySet().size()); Verify.assertIterableSize(1, multimap.get(DonutType.BAVARIAN_CREAM)); Verify.assertAllSatisfy( multimap.get(DonutType.BAVARIAN_CREAM), customer -> customer.named("Ted Smith")); }
public Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered() { return null; }
DonutShop { public Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered() { return null; } }
DonutShop { public Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered() { return null; } }
DonutShop { public Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered() { return null; } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
DonutShop { public Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered() { return null; } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
@Test public void getDonutPriceStatistics() { var stats1 = this.donutShop.getDonutPriceStatistics(this.today, this.today); Assert.assertEquals(9.45d, stats1.getSum(), 0.01); Assert.assertEquals(1.35d, stats1.getAverage(), 0.01); Assert.assertEquals(7, stats1.getCount(), 0.01); var stats2 = this.donutShop.getDonutPriceStatistics(this.tomorrow, this.tomorrow); Assert.assertEquals(12.0d, stats2.getSum(), 0.01); Assert.assertEquals(1.0d, stats2.getAverage(), 0.01); Assert.assertEquals(12, stats2.getCount(), 0.01); var stats3 = this.donutShop.getDonutPriceStatistics(this.yesterday, this.yesterday); Assert.assertEquals(20.9d, stats3.getSum(), 0.001); Assert.assertEquals(0.95d, stats3.getAverage(), 0.01); Assert.assertEquals(22, stats3.getCount(), 0.01); var statsTotal = this.donutShop.getDonutPriceStatistics(this.yesterday, this.tomorrow); Assert.assertEquals(42.35d, statsTotal.getSum(), 0.01); Assert.assertEquals(1.03d, statsTotal.getAverage(), 0.01); Assert.assertEquals(41, statsTotal.getCount(), 0.01); Assert.assertEquals(0.95, statsTotal.getMin(), 0.01); Assert.assertEquals(1.35, statsTotal.getMax(), 0.01); }
public DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate) { return null; }
DonutShop { public DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate) { return null; } }
DonutShop { public DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate) { return null; } }
DonutShop { public DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate) { return null; } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
DonutShop { public DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate) { return null; } void makeDonuts(DonutType type, int count); Delivery deliverOrder(String customerName, LocalDate date, String donutTypeCounts); Bag<DonutType> getDonuts(); MutableList<ObjectIntPair<DonutType>> getTopDonuts(int n); double getTotalDeliveryValueFor(LocalDate date); Customer getTopCustomer(); Multimap<DonutType, Customer> getCustomersByDonutTypesOrdered(); DoubleSummaryStatistics getDonutPriceStatistics(LocalDate fromDate, LocalDate toDate); @Override String toString(); }
@Test public void dealHands() { var jdk1Shuffled = this.jdk1Deck.shuffle(new Random(1)); var jdk2Shuffled = this.jdk2Deck.shuffle(new Random(1)); var jdk1Hands = this.jdk1Deck.dealHands(jdk1Shuffled, 5, 5); var jdk2Hands = this.jdk2Deck.dealHands(jdk2Shuffled, 5, 5); Assert.assertEquals(jdk1Hands, jdk2Hands); }
public List<Set<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { return null; }
JDK8DeckOfCardsAsList { public List<Set<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } }
JDK8DeckOfCardsAsList { public List<Set<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } JDK8DeckOfCardsAsList(); }
JDK8DeckOfCardsAsList { public List<Set<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } JDK8DeckOfCardsAsList(); 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(); }
JDK8DeckOfCardsAsList { public List<Set<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { return null; } JDK8DeckOfCardsAsList(); 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(); }
@Test public void hasOverlappingMeeting() { Assert.assertTrue(this.calendar.hasOverlappingMeeting( LocalDate.of(2017, 7, 7), LocalTime.NOON, Duration.ofHours(1))); }
public boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration) { return false; }
MyCalendar { public boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration) { return false; } }
MyCalendar { public boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration) { return false; } MyCalendar(TimeZone timezone); }
MyCalendar { public boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration) { return false; } MyCalendar(TimeZone timezone); ZoneId getZoneId(); FullMonth getMeetingsForYearMonth(int year, Month month); SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date); WorkWeek getMeetingsForWorkWeekOf(LocalDate value); FullWeek getMeetingsForFullWeekOf(LocalDate value); boolean addMeeting(String subject, LocalDate date, LocalTime startTime, Duration duration); boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration); MutableList<Interval> getAvailableTimeslots(LocalDate date); @Override String toString(); }
MyCalendar { public boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration) { return false; } MyCalendar(TimeZone timezone); ZoneId getZoneId(); FullMonth getMeetingsForYearMonth(int year, Month month); SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date); WorkWeek getMeetingsForWorkWeekOf(LocalDate value); FullWeek getMeetingsForFullWeekOf(LocalDate value); boolean addMeeting(String subject, LocalDate date, LocalTime startTime, Duration duration); boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration); MutableList<Interval> getAvailableTimeslots(LocalDate date); @Override String toString(); }
@Test public void getMeetingsForDate() { SortedSetIterable<Meeting> meetingsForJuly6 = this.calendar.getMeetingsForDate(LocalDate.of(2017, 7, 6)); Verify.assertSize(1, meetingsForJuly6); System.out.println(meetingsForJuly6); }
public SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date) { SortedSetIterable<Meeting> set = this.meetings.get(date); return set; }
MyCalendar { public SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date) { SortedSetIterable<Meeting> set = this.meetings.get(date); return set; } }
MyCalendar { public SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date) { SortedSetIterable<Meeting> set = this.meetings.get(date); return set; } MyCalendar(TimeZone timezone); }
MyCalendar { public SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date) { SortedSetIterable<Meeting> set = this.meetings.get(date); return set; } MyCalendar(TimeZone timezone); ZoneId getZoneId(); FullMonth getMeetingsForYearMonth(int year, Month month); SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date); WorkWeek getMeetingsForWorkWeekOf(LocalDate value); FullWeek getMeetingsForFullWeekOf(LocalDate value); boolean addMeeting(String subject, LocalDate date, LocalTime startTime, Duration duration); boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration); MutableList<Interval> getAvailableTimeslots(LocalDate date); @Override String toString(); }
MyCalendar { public SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date) { SortedSetIterable<Meeting> set = this.meetings.get(date); return set; } MyCalendar(TimeZone timezone); ZoneId getZoneId(); FullMonth getMeetingsForYearMonth(int year, Month month); SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date); WorkWeek getMeetingsForWorkWeekOf(LocalDate value); FullWeek getMeetingsForFullWeekOf(LocalDate value); boolean addMeeting(String subject, LocalDate date, LocalTime startTime, Duration duration); boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration); MutableList<Interval> getAvailableTimeslots(LocalDate date); @Override String toString(); }
@Test public void getMeetingsForWorkWeekOf() { final WorkWeek week = this.calendar.getMeetingsForWorkWeekOf(LocalDate.of(2017, 7, 6)); Assert.assertEquals(4, week.getNumberOfMeetings()); System.out.println(week); }
public WorkWeek getMeetingsForWorkWeekOf(LocalDate value) { return new WorkWeek(value, this.meetings); }
MyCalendar { public WorkWeek getMeetingsForWorkWeekOf(LocalDate value) { return new WorkWeek(value, this.meetings); } }
MyCalendar { public WorkWeek getMeetingsForWorkWeekOf(LocalDate value) { return new WorkWeek(value, this.meetings); } MyCalendar(TimeZone timezone); }
MyCalendar { public WorkWeek getMeetingsForWorkWeekOf(LocalDate value) { return new WorkWeek(value, this.meetings); } MyCalendar(TimeZone timezone); ZoneId getZoneId(); FullMonth getMeetingsForYearMonth(int year, Month month); SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date); WorkWeek getMeetingsForWorkWeekOf(LocalDate value); FullWeek getMeetingsForFullWeekOf(LocalDate value); boolean addMeeting(String subject, LocalDate date, LocalTime startTime, Duration duration); boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration); MutableList<Interval> getAvailableTimeslots(LocalDate date); @Override String toString(); }
MyCalendar { public WorkWeek getMeetingsForWorkWeekOf(LocalDate value) { return new WorkWeek(value, this.meetings); } MyCalendar(TimeZone timezone); ZoneId getZoneId(); FullMonth getMeetingsForYearMonth(int year, Month month); SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date); WorkWeek getMeetingsForWorkWeekOf(LocalDate value); FullWeek getMeetingsForFullWeekOf(LocalDate value); boolean addMeeting(String subject, LocalDate date, LocalTime startTime, Duration duration); boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration); MutableList<Interval> getAvailableTimeslots(LocalDate date); @Override String toString(); }
@Test public void getMeetingsForFullWeekOf() { final FullWeek week = this.calendar.getMeetingsForFullWeekOf(LocalDate.of(2017, 7, 6)); Assert.assertEquals(6, week.getNumberOfMeetings()); System.out.println(week); }
public FullWeek getMeetingsForFullWeekOf(LocalDate value) { return new FullWeek(value, this.meetings); }
MyCalendar { public FullWeek getMeetingsForFullWeekOf(LocalDate value) { return new FullWeek(value, this.meetings); } }
MyCalendar { public FullWeek getMeetingsForFullWeekOf(LocalDate value) { return new FullWeek(value, this.meetings); } MyCalendar(TimeZone timezone); }
MyCalendar { public FullWeek getMeetingsForFullWeekOf(LocalDate value) { return new FullWeek(value, this.meetings); } MyCalendar(TimeZone timezone); ZoneId getZoneId(); FullMonth getMeetingsForYearMonth(int year, Month month); SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date); WorkWeek getMeetingsForWorkWeekOf(LocalDate value); FullWeek getMeetingsForFullWeekOf(LocalDate value); boolean addMeeting(String subject, LocalDate date, LocalTime startTime, Duration duration); boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration); MutableList<Interval> getAvailableTimeslots(LocalDate date); @Override String toString(); }
MyCalendar { public FullWeek getMeetingsForFullWeekOf(LocalDate value) { return new FullWeek(value, this.meetings); } MyCalendar(TimeZone timezone); ZoneId getZoneId(); FullMonth getMeetingsForYearMonth(int year, Month month); SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date); WorkWeek getMeetingsForWorkWeekOf(LocalDate value); FullWeek getMeetingsForFullWeekOf(LocalDate value); boolean addMeeting(String subject, LocalDate date, LocalTime startTime, Duration duration); boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration); MutableList<Interval> getAvailableTimeslots(LocalDate date); @Override String toString(); }
@Test public void getMeetingsForMonthOf() { FullMonth month = this.calendar.getMeetingsForYearMonth(2017, Month.JULY); Assert.assertEquals(6, month.getNumberOfMeetings()); System.out.println(month); }
public FullMonth getMeetingsForYearMonth(int year, Month month) { return new FullMonth(LocalDate.of(year, month, 1), this.meetings); }
MyCalendar { public FullMonth getMeetingsForYearMonth(int year, Month month) { return new FullMonth(LocalDate.of(year, month, 1), this.meetings); } }
MyCalendar { public FullMonth getMeetingsForYearMonth(int year, Month month) { return new FullMonth(LocalDate.of(year, month, 1), this.meetings); } MyCalendar(TimeZone timezone); }
MyCalendar { public FullMonth getMeetingsForYearMonth(int year, Month month) { return new FullMonth(LocalDate.of(year, month, 1), this.meetings); } MyCalendar(TimeZone timezone); ZoneId getZoneId(); FullMonth getMeetingsForYearMonth(int year, Month month); SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date); WorkWeek getMeetingsForWorkWeekOf(LocalDate value); FullWeek getMeetingsForFullWeekOf(LocalDate value); boolean addMeeting(String subject, LocalDate date, LocalTime startTime, Duration duration); boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration); MutableList<Interval> getAvailableTimeslots(LocalDate date); @Override String toString(); }
MyCalendar { public FullMonth getMeetingsForYearMonth(int year, Month month) { return new FullMonth(LocalDate.of(year, month, 1), this.meetings); } MyCalendar(TimeZone timezone); ZoneId getZoneId(); FullMonth getMeetingsForYearMonth(int year, Month month); SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date); WorkWeek getMeetingsForWorkWeekOf(LocalDate value); FullWeek getMeetingsForFullWeekOf(LocalDate value); boolean addMeeting(String subject, LocalDate date, LocalTime startTime, Duration duration); boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration); MutableList<Interval> getAvailableTimeslots(LocalDate date); @Override String toString(); }
@Test public void getAvailableTimeslots() { MutableList<Interval> availableTimeslots1 = this.calendar.getAvailableTimeslots(LocalDate.of(2017, 7, 6)); Assert.assertEquals(2, availableTimeslots1.size()); System.out.println(availableTimeslots1); MutableList<Interval> availableTimeslots2 = this.calendar.getAvailableTimeslots(LocalDate.of(2017, 7, 1)); Assert.assertEquals(1, availableTimeslots2.size()); System.out.println(availableTimeslots2); }
public MutableList<Interval> getAvailableTimeslots(LocalDate date) { return Lists.mutable.empty(); }
MyCalendar { public MutableList<Interval> getAvailableTimeslots(LocalDate date) { return Lists.mutable.empty(); } }
MyCalendar { public MutableList<Interval> getAvailableTimeslots(LocalDate date) { return Lists.mutable.empty(); } MyCalendar(TimeZone timezone); }
MyCalendar { public MutableList<Interval> getAvailableTimeslots(LocalDate date) { return Lists.mutable.empty(); } MyCalendar(TimeZone timezone); ZoneId getZoneId(); FullMonth getMeetingsForYearMonth(int year, Month month); SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date); WorkWeek getMeetingsForWorkWeekOf(LocalDate value); FullWeek getMeetingsForFullWeekOf(LocalDate value); boolean addMeeting(String subject, LocalDate date, LocalTime startTime, Duration duration); boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration); MutableList<Interval> getAvailableTimeslots(LocalDate date); @Override String toString(); }
MyCalendar { public MutableList<Interval> getAvailableTimeslots(LocalDate date) { return Lists.mutable.empty(); } MyCalendar(TimeZone timezone); ZoneId getZoneId(); FullMonth getMeetingsForYearMonth(int year, Month month); SortedSetIterable<Meeting> getMeetingsForDate(LocalDate date); WorkWeek getMeetingsForWorkWeekOf(LocalDate value); FullWeek getMeetingsForFullWeekOf(LocalDate value); boolean addMeeting(String subject, LocalDate date, LocalTime startTime, Duration duration); boolean hasOverlappingMeeting(LocalDate date, LocalTime startTime, Duration duration); MutableList<Interval> getAvailableTimeslots(LocalDate date); @Override String toString(); }
@Test public void cardsBySuit() { var jdk1CardsBySuit = this.jdk1Deck.getCardsBySuit(); var jdk2CardsBySuit = this.jdk2Deck.getCardsBySuit(); Assert.assertEquals(jdk1CardsBySuit.get(Suit.CLUBS), jdk2CardsBySuit.get(Suit.CLUBS)); }
public Map<Suit, List<Card>> getCardsBySuit() { return this.cardsBySuit; }
JDK8DeckOfCardsAsList { public Map<Suit, List<Card>> getCardsBySuit() { return this.cardsBySuit; } }
JDK8DeckOfCardsAsList { public Map<Suit, List<Card>> getCardsBySuit() { return this.cardsBySuit; } JDK8DeckOfCardsAsList(); }
JDK8DeckOfCardsAsList { public Map<Suit, List<Card>> getCardsBySuit() { return this.cardsBySuit; } JDK8DeckOfCardsAsList(); 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(); }
JDK8DeckOfCardsAsList { public Map<Suit, List<Card>> getCardsBySuit() { return this.cardsBySuit; } JDK8DeckOfCardsAsList(); 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(); }
@Test public void cardsBySuitIsImmutable() { var jdk2CardsBySuit = this.jdk2Deck.getCardsBySuit(); Verify.assertThrows( UnsupportedOperationException.class, () -> jdk2CardsBySuit.remove(Suit.CLUBS)); Verify.assertThrows( UnsupportedOperationException.class, jdk2CardsBySuit::clear); Verify.assertThrows( UnsupportedOperationException.class, () -> jdk2CardsBySuit.get(Suit.CLUBS).remove(0)); Verify.assertThrows( UnsupportedOperationException.class, () -> jdk2CardsBySuit.get(Suit.CLUBS).add(null)); Verify.assertThrows( UnsupportedOperationException.class, jdk2CardsBySuit.get(Suit.CLUBS)::clear); }
public Map<Suit, List<Card>> getCardsBySuit() { return this.cardsBySuit; }
JDK8DeckOfCardsAsList { public Map<Suit, List<Card>> getCardsBySuit() { return this.cardsBySuit; } }
JDK8DeckOfCardsAsList { public Map<Suit, List<Card>> getCardsBySuit() { return this.cardsBySuit; } JDK8DeckOfCardsAsList(); }
JDK8DeckOfCardsAsList { public Map<Suit, List<Card>> getCardsBySuit() { return this.cardsBySuit; } JDK8DeckOfCardsAsList(); 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(); }
JDK8DeckOfCardsAsList { public Map<Suit, List<Card>> getCardsBySuit() { return this.cardsBySuit; } JDK8DeckOfCardsAsList(); 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(); }
@Test public void countsBySuit() { Assert.assertEquals( this.jdk1Deck.countsBySuit().get(Suit.CLUBS), this.jdk2Deck.countsBySuit().get(Suit.CLUBS)); }
public Map<Suit, Long> countsBySuit() { return null; }
JDK8DeckOfCardsAsList { public Map<Suit, Long> countsBySuit() { return null; } }
JDK8DeckOfCardsAsList { public Map<Suit, Long> countsBySuit() { return null; } JDK8DeckOfCardsAsList(); }
JDK8DeckOfCardsAsList { public Map<Suit, Long> countsBySuit() { return null; } JDK8DeckOfCardsAsList(); 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(); }
JDK8DeckOfCardsAsList { public Map<Suit, Long> countsBySuit() { return null; } JDK8DeckOfCardsAsList(); 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(); }
@Test public void countsByRank() { Assert.assertEquals( this.jdk1Deck.countsByRank().get(Rank.TEN), this.jdk2Deck.countsByRank().get(Rank.TEN)); }
public Map<Rank, Long> countsByRank() { return null; }
JDK8DeckOfCardsAsList { public Map<Rank, Long> countsByRank() { return null; } }
JDK8DeckOfCardsAsList { public Map<Rank, Long> countsByRank() { return null; } JDK8DeckOfCardsAsList(); }
JDK8DeckOfCardsAsList { public Map<Rank, Long> countsByRank() { return null; } JDK8DeckOfCardsAsList(); 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(); }
JDK8DeckOfCardsAsList { public Map<Rank, Long> countsByRank() { return null; } JDK8DeckOfCardsAsList(); 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(); }