public boolean isStable() {
        boolean stable = true;
        boolean[][] nextGrid = this.nextGeneration();
        for (int i = 0; i < grid.length; i++) {
            for (int j = 0; j < grid[0].length; j++) {
                stable = stable && (grid[i][j] == nextGrid[i][j]);
            }
        }
        return stable;
    }