public class ExtremeLifeCell extends Cell { public CellState getNextState () // EFFECTS: Returns the next state for this cell. // The next state will be alive if this cell or any of its neighbors // is currently alive. { if (countAliveNeighbors () > 0) { // If the cell has at least one neighboring cell // that is alive, this cell should become alive. return CellState.createAlive (); } else { // Otherwise, the cell maintains its previous state. return getState (); } } }