Program: 26498
Project: 26498
Buggy source:
@Test public void testGameStart(){
  Game game=new Game();
  game.setName("String_Node_Str");
  game.setGameType(GameType.TOURNAMENT);
  GameStructure gs=new GameStructure();
  gs.setBlindLength(10);
  gs.setBlindLevels(CommonTournamentFormats.TWO_HR_NINEPPL.getBlindLevels());
  gs.setStartingChips(1000);
  game.setGameStructure(gs);
  game=gameService.saveGame(game);
  Player p1=new Player();
  p1.setChips(game.getGameStructure().getStartingChips());
  p1.setName("String_Node_Str");
  p1=gameService.addNewPlayerToGame(game,p1);
  Player p2=new Player();
  p2.setChips(game.getGameStructure().getStartingChips());
  p2.setName("String_Node_Str");
  p2=gameService.addNewPlayerToGame(game,p2);
  Player p3=new Player();
  p3.setChips(game.getGameStructure().getStartingChips());
  p3.setName("String_Node_Str");
  p3=gameService.addNewPlayerToGame(game,p3);
  flushAndClear();
  assertEquals(PlayerStatus.NOT_STARTED,playerActionService.getPlayerStatus(p1));
  assertEquals(PlayerStatus.NOT_STARTED,playerActionService.getPlayerStatus(p2));
  assertEquals(PlayerStatus.NOT_STARTED,playerActionService.getPlayerStatus(p3));
  assertEquals(GameStatus.NOT_STARTED,GameUtil.getGameStatus(game));
  game=gameService.getGameById(game.getId(),true);
  game=gameService.startGame(game);
  assertTrue(game.isStarted());
  assertEquals(3,game.getPlayersRemaining());
  assertEquals(PlayerStatus.SEATING,playerActionService.getPlayerStatus(p1));
  assertEquals(PlayerStatus.SEATING,playerActionService.getPlayerStatus(p2));
  assertEquals(PlayerStatus.SEATING,playerActionService.getPlayerStatus(p3));
  assertEquals(GameStatus.SEATING,GameUtil.getGameStatus(game));
  HandEntity hand=handService.startNewHand(game);
  assertEquals(game.getGameStructure().getCurrentBlindLevel(),BlindLevel.BLIND_10_20);
  assertEquals(hand.getBlindLevel(),BlindLevel.BLIND_10_20);
  Player btn=hand.getCurrentToAct();
  Player sb=handService.getPlayerInSB(hand);
  Player bb=handService.getPlayerInBB(hand);
  assertEquals(PlayerStatus.WAITING,playerActionService.getPlayerStatus(sb));
  assertEquals(PlayerStatus.WAITING,playerActionService.getPlayerStatus(bb));
  assertEquals(PlayerStatus.ACTION_TO_CALL,playerActionService.getPlayerStatus(btn));
  assertEquals(GameStatus.PREFLOP,GameUtil.getGameStatus(game));
  assertEquals(1000,btn.getChips());
  assertEquals(990,sb.getChips());
  assertEquals(980,bb.getChips());
  assertEquals(30,hand.getPot());
  assertEquals(20,hand.getLastBetAmount());
  assertEquals(20,hand.getTotalBetAmount());
}

Fixed version (ground truth):
@Test public void testGameStart(){
  Game game=new Game();
  game.setName("String_Node_Str");
  game.setGameType(GameType.TOURNAMENT);
  GameStructure gs=new GameStructure();
  gs.setBlindLength(10);
  gs.setBlindLevels(CommonTournamentFormats.TWO_HR_NINEPPL.getBlindLevels());
  gs.setStartingChips(1000);
  game.setGameStructure(gs);
  game=gameService.saveGame(game);
  flushAndClear();
  game=gameService.getGameById(game.getId(),true);
  Player p1=new Player();
  p1.setChips(game.getGameStructure().getStartingChips());
  p1.setName("String_Node_Str");
  p1=gameService.addNewPlayerToGame(game,p1);
  Player p2=new Player();
  p2.setChips(game.getGameStructure().getStartingChips());
  p2.setName("String_Node_Str");
  p2=gameService.addNewPlayerToGame(game,p2);
  Player p3=new Player();
  p3.setChips(game.getGameStructure().getStartingChips());
  p3.setName("String_Node_Str");
  p3=gameService.addNewPlayerToGame(game,p3);
  flushAndClear();
  assertEquals(PlayerStatus.NOT_STARTED,playerActionService.getPlayerStatus(p1));
  assertEquals(PlayerStatus.NOT_STARTED,playerActionService.getPlayerStatus(p2));
  assertEquals(PlayerStatus.NOT_STARTED,playerActionService.getPlayerStatus(p3));
  assertEquals(GameStatus.NOT_STARTED,GameUtil.getGameStatus(game));
  game=gameService.getGameById(game.getId(),true);
  game=gameService.startGame(game);
  assertTrue(game.isStarted());
  assertEquals(3,game.getPlayersRemaining());
  assertEquals(PlayerStatus.SEATING,playerActionService.getPlayerStatus(p1));
  assertEquals(PlayerStatus.SEATING,playerActionService.getPlayerStatus(p2));
  assertEquals(PlayerStatus.SEATING,playerActionService.getPlayerStatus(p3));
  assertEquals(GameStatus.SEATING,GameUtil.getGameStatus(game));
  HandEntity hand=handService.startNewHand(game);
  assertEquals(game.getGameStructure().getCurrentBlindLevel(),BlindLevel.BLIND_10_20);
  assertEquals(hand.getBlindLevel(),BlindLevel.BLIND_10_20);
  Player btn=hand.getCurrentToAct();
  Player sb=handService.getPlayerInSB(hand);
  Player bb=handService.getPlayerInBB(hand);
  assertEquals(PlayerStatus.WAITING,playerActionService.getPlayerStatus(sb));
  assertEquals(PlayerStatus.WAITING,playerActionService.getPlayerStatus(bb));
  assertEquals(PlayerStatus.ACTION_TO_CALL,playerActionService.getPlayerStatus(btn));
  assertEquals(GameStatus.PREFLOP,GameUtil.getGameStatus(game));
  assertEquals(1000,btn.getChips());
  assertEquals(990,sb.getChips());
  assertEquals(980,bb.getChips());
  assertEquals(30,hand.getPot());
  assertEquals(20,hand.getLastBetAmount());
  assertEquals(20,hand.getTotalBetAmount());
}