### Question:
LotoGrid implements LotoGridInterface, LotoGridGUIListener { @Override public void clic(int number) { if (1 <= number && number <= this.maxNumber) { Grid oldGrid = this.gridHistory.peek().getValue0(); Grid newGrid = oldGrid.derive(number); Integer newLastNumber = getNewLastNumber(number); this.gridHistory.push(Pair.with(newGrid, newLastNumber)); 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 testHistoryOverflow() { LotoGrid grid = new LotoGrid(HISTORY_DEPTH, MAX_NUMBER); for (int i = 0; i < HISTORY_DEPTH * 2; i++) { grid.clic(MAX_NUMBER); } }
@Test public void testClic() { LotoGrid grid = new LotoGrid(HISTORY_DEPTH, MAX_NUMBER); for (int i = 1; i <= MAX_NUMBER; i++) { grid.clic(i); assertThat(grid.getActualGrid().getNumbers()).isEqualTo(rangeSet(1, i)); } }