SimpleCell implements Cell { @Override public void onNeighborStateChange(int newState) { if (newState == STATE_DEAD) { decreaseNeighborCount(); } else { increaseNeighborCount(); } } SimpleCell(int x, int y, int state); @Override void setOverseer(Overseer overseer); @Override void reset(int state); @Override long getId(); @Override int getX(); @Override int getY(); @Override int getState(); @Override void setState(int newState); @Override boolean isAlive(); @Override boolean isDead(); @Override void onNeighborStateChange(int newState); int getNeighborCount(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testOnNeighborBorn() { cell.onNeighborStateChange(Cell.STATE_ALIVE); cell.onNeighborStateChange(Cell.STATE_ALIVE); assertThat(cell.neighborCount).isEqualTo(2); }
@Test public void testOnNeighborDies() { cell.onNeighborStateChange(Cell.STATE_ALIVE); cell.onNeighborStateChange(Cell.STATE_ALIVE); cell.onNeighborStateChange(Cell.STATE_ALIVE); cell.onNeighborStateChange(Cell.STATE_DEAD); assertThat(cell.neighborCount).isEqualTo(2); }