private void toggleFavorite(){
  for (  String game : list.getSelectedValuesList()) {
    if (favorites.contains(game)) {
      favorites.remove(game);
    }
 else {
      favorites.add(game);
    }
  }
  saveFavorites();
  update();
}

private void toggleFavorite ( ) { for ( String game : list . getSelectedValuesList ( ) ) { if ( favorites . contains ( game ) ) { favorites . remove ( game ) ; } else { favorites . add ( game ) ; } } saveFavorites ( ) ; update ( ) ; }
removes all selected favorites and adds all selected non - favorites as favorites .
