### Question:
LotoGrid implements LotoGridInterface, LotoGridGUIListener { @Override public void undo() { if (this.gridHistory.size() > 1) { this.gridHistory.pop(); save(); fireUpdate(); } } LotoGrid(int historyDepth, int maxNumber, String profileName);  LotoGrid(int historyDepth, int maxNumber); @Override void clic(int number); @Override void clear(); @Override void undo(); void save(); void fireUpdate(); Set<LotoGridListener> getListeners(); @Override void onClic(int number);  }### Answer:
@Test public void testWrongUndos() { final int NB_UNDO = 100; LotoGrid grid = new LotoGrid(HISTORY_DEPTH, MAX_NUMBER); for (int i = 0; i < NB_UNDO; i++) { grid.undo(); } }
@Test public void testUndo() { LotoGrid grid = new LotoGrid(MAX_NUMBER + 1, MAX_NUMBER); for (int i = 1; i <= MAX_NUMBER; i++) { grid.clic(i); } for (int i = MAX_NUMBER; i >= 0; i--) { assertThat(grid.getActualGrid().getNumbers()).isEqualTo(rangeSet(1, i)); grid.undo(); } }