Buggy code:
public class Level { protected Board board ; protected int resetBoardMoves ; protected int swapTwoTilesMoves ; protected int removeTileMoves ; protected int id ; protected int currentScore ; protected int highScore ; protected int oneStarScore ; protected int twoStarScore ; protected int threeStarScore ; protected int movesLeft ; protected int bonusFrequency ; protected Timer time ; protected int minutes ; protected int seconds ; protected boolean isLocked ; protected boolean [ ] tileRange ; protected boolean [ ] allowedSpecialMoves ; public Level ( Board board , int id ) { } public Level ( Board board , int resetBoardMoves , int swapTwoTilesMoves , int removeTileMoves , int id , int currentScore , int highScore , int oneStarScore , int twoStarScore , int threeStarScore , int movesLeft , int bonusFrequency , Timer time , int minutes , int seconds , boolean isLocked , boolean [ ] tileRange , boolean [ ] allowedSpecialMoves ) { } public void initialize ( ) { this . board = new Board ( board . dimension ) ; for ( int i = 0 ; i < ( ( board . getDimension ( ) ) * ( board . getDimension ( ) ) ) ; i ++ ) { Tile tile = board . getGrid ( ) . get ( i ) . getTile ( ) ; ArrayList < Integer > values = new ArrayList < Integer > ( ) ; for ( int j = 0 ; j < 5 ; j ++ ) if ( getTileRange ( ) [ j ] ) { values . add ( ( j + 1 ) ) ; } values . add ( 6 ) ; Random rand = new Random ( ) ; int value = rand . nextInt ( values . size ( ) ) ; Random rand2 = new Random ( ) ; <START_BUG> board . getGrid ( ) . get ( i ) . setTile ( new Tile ( values . get ( value ) , rand2 . nextInt ( 3 ) , tile . getRow ( ) , tile . getColumn ( ) , tile . isSelected ) ) ; <END_BUG> } } public void hasWon ( ) { } public Board getBoard ( ) { } public void setBoard ( Board board ) { } public int getId ( ) { } public void setId ( int id ) { } public int getCurrentScore ( ) { } public void setCurrentScore ( int currentScore ) { } public int getHighScore ( ) { } public void setHighScore ( int highScore ) { } public int getOneStarScore ( ) { } public void setOneStarScore ( int oneStarScore ) { } public int getTwoStarScore ( ) { } public void setTwoStarScore ( int twoStarScore ) { } public int getThreeStarScore ( ) { } public void setThreeStarScore ( int threeStarScore ) { } public int getMovesLeft ( ) { } public void setMovesLeft ( int movesLeft ) { } public int getBonusFrequency ( ) { } public void setBonusFrequency ( int bonusFrequency ) { } public Timer getTime ( ) { } public void setTime ( Timer time ) { } public boolean isLocked ( ) { } public void setLocked ( boolean isLocked ) { } public boolean [ ] getTileRange ( ) { } public void setTileRange ( boolean [ ] tileRange ) { } public int getResetBoardMoves ( ) { } public void setResetBoardMoves ( int resetBoardMoves ) { } public int getSwapTwoTilesMoves ( ) { } public void setSwapTwoTilesMoves ( int swapTwoTilesMoves ) { } public int getRemoveTileMoves ( ) { } public void setRemoveTileMoves ( int removeTileMoves ) { } public boolean [ ] getAllowedSpecialMoves ( ) { } public void setAllowedSpecialMoves ( boolean [ ] allowedSpecialMoves ) { } public int getMinutes ( ) { } public void setMinutes ( int minutes ) { } public int getSeconds ( ) { } public void setSeconds ( int seconds ) { } }

Fix:
board . getGrid ( ) . get ( i ) . setTile ( new Tile ( values . get ( value ) , ( ( rand2 . nextInt ( 3 ) ) + 1 ) , tile . getRow ( ) , tile . getColumn ( ) , tile . isSelected ) ) ;