We have a game state class:
class GameState(val phase: String, val playerIds: Set[Int])
Change the class without writing new methods so we can copy the state of the game by adding players:
val state = GameState("waiting", Set.empty)
state.copy(playerIds = state.playerIds + 1) // GameState("waiting", Set(1))