public static void next(Grid grid) {
        for (int i = 0; i < (grid.getColumns() * grid.getRows()); i++) {
            getNeighbors(grid, i);

            if(grid.getEntity(i).getState().equals(EntityStates.ALIVE)) {
                if(grid.getEntity(i).getLiveNeighbor() < 2 || grid.getEntity(i).getLiveNeighbor() > 3) {
                    grid.getEntity(i).setState(EntityStates.DEAD);
                }
            } else if(grid.getEntity(i).getLiveNeighbor() == 3) {
                grid.getEntity(i).setState(EntityStates.ALIVE);
            }
        }
    }