/** * Checks if the list is empty or if the player is already in the team if there is a team and the * person is not in it, the player is added to the team Author Qun, Kaj * * @param player */ public Player addPlayer(Player player) { if (this.players == null) this.players = new ArrayList<>(); if (players.size() == 0 || !players.contains(player)) { players.add(player); player.setTeam(this); log.log(Level.INFO, "Player has been added to the team"); return player; } log.log(Level.INFO, "Player has not been added to the team"); player = null; return player; }