### Question:
Round implements UnaryOperator<Stream<Player>> { @Override public Stream<Player> apply(Stream<Player> players) { List<Bid> bids = getAllBids(players, prizeCard); Bid winningBid = findWinningBid(bids); Player newWinner = winningBid.getBidder().winsRound(winningBid); String winner = winningBid.getBidder().getName(); Stream<Player> result = Stream.concat( Stream.of(newWinner), bids.stream() .filter(b -> ! b.getBidder().getName().equals(winner)) .map(b -> b.getBidder().losesRound(b))); return result; } Round(int prizeCard); protected  Round(); @Override Stream<Player> apply(Stream<Player> players);  }### Answer:
@Test public void testApply_Basic() { int numCards = 12; int maxCard = numCards; List<Player> players = new ArrayList<>(); Hand h1 = new Hand(Arrays.asList(new Integer[]{1,2,3})); Player p1 = new Player("p1", strategy, maxCard, h1); Hand h2 = new Hand(Arrays.asList(new Integer[]{4,5,6})); Player p2 = new Player("p2", strategy, maxCard, h2); Hand h3 = new Hand(Arrays.asList(new Integer[]{7,8,9})); Player p3 = new Player("p3", strategy, maxCard, h3); players.add(p1); players.add(p2); players.add(p3); int prizeCard = 10; List<Player> newPlayers = new Round(prizeCard).apply(players.stream()).collect(toList()); assertEquals(3, newPlayers.size()); assertEquals(2, newPlayers.get(0).getNumCardsInHand()); assertEquals(2, newPlayers.get(1).getNumCardsInHand()); assertEquals(2, newPlayers.get(2).getNumCardsInHand()); assertEquals(1, newPlayers.stream().filter(p -> p.getPlayerStats().getNumRoundsWon() == 1).count()); assertEquals(1, newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 10).count()); assertEquals(2, newPlayers.stream().filter(p -> p.getPlayerStats().getNumRoundsWon() == 0).count()); assertEquals(2, newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 0).count()); }