@Test public void whenDropOutAndOnePlayerLeftThenEnd() { Game game = mock(Game.class); GamePlayerStorage gamePlayerStorage = mock(GamePlayerStorage.class); PlayerDropOutEvent playerDropOutEvent = new PlayerDropOutEvent(UUID.randomUUID()); when(gamePlayerStorage.getAlivePlayerCount()).thenReturn(1L); SoloDropOutListener soloDropOutListener = new SoloDropOutListener(game, gamePlayerStorage); soloDropOutListener.onDropOut(playerDropOutEvent); verify(game).end(); }
@EventHandler public void onDropOut(PlayerDropOutEvent event) { if (gamePlayerStorage.getAlivePlayerCount() == 1) { game.end(); } }
SoloDropOutListener implements Listener { @EventHandler public void onDropOut(PlayerDropOutEvent event) { if (gamePlayerStorage.getAlivePlayerCount() == 1) { game.end(); } } }
SoloDropOutListener implements Listener { @EventHandler public void onDropOut(PlayerDropOutEvent event) { if (gamePlayerStorage.getAlivePlayerCount() == 1) { game.end(); } }  }
SoloDropOutListener implements Listener { @EventHandler public void onDropOut(PlayerDropOutEvent event) { if (gamePlayerStorage.getAlivePlayerCount() == 1) { game.end(); } }  @EventHandler void onDropOut(PlayerDropOutEvent event); }
SoloDropOutListener implements Listener { @EventHandler public void onDropOut(PlayerDropOutEvent event) { if (gamePlayerStorage.getAlivePlayerCount() == 1) { game.end(); } }  @EventHandler void onDropOut(PlayerDropOutEvent event);  }