protected int numberOfNeighborhoodAliveCells(int i, int j) {
            int alive = 0;
            for (int a = i - 1; a <= i + 1; a++) {
                    for (int b = j - 1; b <= j + 1; b++) {
                            if (model.validPosition(a, b)  && (!(a==i && b == j)) && getCell(a, b).isAlive()) {
                                    alive++;
                            }
                    }
            }
            return alive;
    }