class Team {
  private Player p1; //  first player on team
  private Player p2; // second player on team
  private int wins;
  private int losses;
  
  public void setPlayer1(Player p) {
      p1 = p;  // equivalent to:  this.p1 = p;
      // this.p2 = p;  // a deliberate bug
  }
  
  public void setPlayer2(Player p) {
    p2 = p;
  }
  
  public Player getPlayer1() {
    return p1;
  }
  
  public Player getPlayer2() {
    return p2;
  }
  
  public int getWins(){
      return wins;
  }
  
  public int getLosses(){
      return losses;
  }
  
  public void won() {
    wins++;    
    // update the player's wins
    p1.won(); // can't do this: p1.wins++;
    p2.won(); 
  }
  
  public void lost() {
    losses++;
    p1.lost();
    p2.lost();
  } 
  
}
