private PlayerWithCard findSamePlayer(List<PlayerWithCard> reserve, Player player) {
   GlobalPosition[] priority = new GlobalPosition[0];
   switch (player.getCurrentPosition().getPositionOnField()) {
     case FORWARD:
       priority = FORWARD_PRIORITY;
       break;
     case MIDFIELDER:
       priority = MIDFIELDIER_PRORITY;
       break;
     case DEFENDER:
       priority = DEFENDER_PRIORITY;
       break;
     case GOALKEEPER:
       priority = GOALKEEPER_PRIORITY;
       break;
   }
   Set<PlayerWithCard> candidates = new TreeSet<>();
   for (GlobalPosition position : priority) {
     for (PlayerWithCard playerWithCard : reserve) {
       if (playerWithCard.player.getCurrentPosition().getPositionOnField() == position) {
         candidates.add(playerWithCard);
       }
     }
   }
   return candidates.iterator().next();
 }
 private void removePlayer(int minute, int playerIndex) {
   PlayerWithCard playerFrom = startPlayers.get(playerIndex);
   Player playerFromField = playerFrom.player;
   events.add(new Event(EventType.RED_CARD, minute, playerFromField, team));
   playerFromField.addRedCard();
   if (playerFromField.getCurrentPosition().getPositionOnField() == GlobalPosition.GOALKEEPER) {
     if (substitutesCount < MAX_SUBSTITUTIONS_COUNT) {
       PlayerWithCard reserveGoalkeeper = null;
       for (PlayerWithCard reservePlayer : reservePlayers) {
         if (reservePlayer.player.getCurrentPositionOnField() == GlobalPosition.GOALKEEPER) {
           reserveGoalkeeper = reservePlayer;
           break;
         }
       }
       if (reserveGoalkeeper != null) {
         changePlayer(minute, playerFrom);
       }
     }
   }
   startPlayers.remove(playerIndex);
 }