/**
 * A player in the game Simple Nim.
 */
public class Player {
  private final String name;

  public Player(String name) {
    if (name == null) {
throw new IllegalArgumentException("Name cannot be null");
} this.name = name; } public String getName() { return this.name; }
public void takeTurn(Pile pile, int sticks) { pile.removeSticks(sticks); }
public String toString() { return this.name; } }