@Test public void whenStateChangedToTheSameThenEventNotDispatched() { abstractGame.setState(GameState.WAITING); verifyZeroInteractions(pluginManager); }
@Override public void setState(GameState newState) { if (newState != this.gameState) { this.gameState = newState; pluginManager.callEvent(new GameStateChangeEvent(this, newState)); } }
AbstractGame implements Game { @Override public void setState(GameState newState) { if (newState != this.gameState) { this.gameState = newState; pluginManager.callEvent(new GameStateChangeEvent(this, newState)); } } }
AbstractGame implements Game { @Override public void setState(GameState newState) { if (newState != this.gameState) { this.gameState = newState; pluginManager.callEvent(new GameStateChangeEvent(this, newState)); } } AbstractGame(GameMap map, PluginManager pluginManager); }
AbstractGame implements Game { @Override public void setState(GameState newState) { if (newState != this.gameState) { this.gameState = newState; pluginManager.callEvent(new GameStateChangeEvent(this, newState)); } } AbstractGame(GameMap map, PluginManager pluginManager); @Override void start(); @Override GameState getState(); @Override void end(); @Override GameMap getMap(); @Override void setMap(GameMap map); @Override void setState(GameState newState); }
AbstractGame implements Game { @Override public void setState(GameState newState) { if (newState != this.gameState) { this.gameState = newState; pluginManager.callEvent(new GameStateChangeEvent(this, newState)); } } AbstractGame(GameMap map, PluginManager pluginManager); @Override void start(); @Override GameState getState(); @Override void end(); @Override GameMap getMap(); @Override void setMap(GameMap map); @Override void setState(GameState newState);  }