### Question:
AutoSaver extends Suspendable implements Tickable { @Override public void tick() { if (!active) { return; } if (justStart) { justStart = false; save.loadAll(); java.awt.Toolkit.getDefaultToolkit().beep(); } else { count++; if (count % TICKS == (TICKS - 1)) { executor.submit(() -> save.saveAll()); } } }  @Value("${game.save.auto}") void setActive(boolean active); @Override void tick(); static final int TICKS; }### Answer:
@Test public void testSaveEachNTicks() throws InterruptedException { verifyNoMoreInteractions(save); autoSaver.tick(); verify(save, only()).loadAll(); reset(save); for (int count = 0; count < AutoSaver.TICKS - 2; count++) { autoSaver.tick(); } verifyNoMoreInteractions(save); autoSaver.tick(); Thread.sleep(1000); verify(save, only()).saveAll(); }