### Question:
Game implements UnaryOperator<List<Player>> { @Override public List<Player> apply(List<Player> players) { Dealer dealer = new Dealer(); Table table = dealer.deal(numCards, players); Hand kitty = table.getKitty(); List<Player> readyPlayers = table.getPlayers(); logger.log("INIT", kitty, readyPlayers); Stream<Player> newPlayers = play(kitty, readyPlayers.stream()); List<Player> newPlayers2 = determineWinner(newPlayers.collect(toList())); logger.log("FINAL", newPlayers2); return newPlayers2; } Game(int numCards, boolean isVerbose); @Override List<Player> apply(List<Player> players);  }### Answer:
@Test public void testApply_Basic() { int numCards = 12; int maxCard = numCards; List<Player> players = new ArrayList<>(); Player p1 = new Player("p1", strategy, maxCard, new Hand()); Player p2 = new Player("p2", strategy, maxCard, new Hand()); Player p3 = new Player("p3", strategy, maxCard, new Hand()); players.add(p1); players.add(p2); players.add(p3); List<Player> newPlayers = new Game(numCards, false).apply(players); assertEquals(3, newPlayers.size()); assertEquals(0, newPlayers.get(0).getNumCardsInHand()); assertEquals(0, newPlayers.get(1).getNumCardsInHand()); assertEquals(0, newPlayers.get(2).getNumCardsInHand()); assertEquals(1, newPlayers.stream().filter(p -> p.getPlayerStats().getNumGamesWon() == 1).count()); assertEquals(2, newPlayers.stream().filter(p -> p.getPlayerStats().getNumGamesWon() == 0).count()); int maxTotal = maxCard + (maxCard - 1) + (maxCard - 2); assertEquals(3, newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() <= maxTotal).count()); assertEquals(3, newPlayers.stream().map(p -> p.getPlayerStats().getNumRoundsWon()).mapToInt(i->i).sum()); }