package rules; public class RulesForNextGeneration { private Cell cell; public RulesForNextGeneration itTurnsOutThat(Cell cell) { this.cell = cell; return this; } public boolean comesAlive() { if (cell.isAlive() && cell.numberOfLiveNeighbors == 2) return true; return (cell.numberOfLiveNeighbors == 3); } }