### Question:
TimerLogic implements RunnableService { public Timer getTimer(int timerNumber) { for (Timer t : this.timerStorage.getAll()) { if (t.getId() == timerNumber) { return t; } } throw new NoSuchElementException(); }  Runnable createTimerRunnable(Timer timer); Timer setTimer(LocalDateTime timerTime); int searchTimerId(); String deleteAllTimers(); String deleteTimer(int timerNumber); String stopRinging(); Timer getTimer(int timerNumber); List<Timer> getAllTimers(); Timer pauseTimer(Timer timer); Timer reactivateTimer(Timer timer); @Override void start(); @Override void stop();  }### Answer:
@Test protected void testGetTimer() { when(this.timerStorage.getAll()).thenReturn(createTimers(3, true)); this.timerNumber = 2; Timer returnedTimer = this.tlogic.getTimer(this.timerNumber); assertThat(returnedTimer.getId(), is(2)); }
@Test protected void testGetTimerNotFound() { when(this.timerStorage.getAll()).thenReturn(createTimers(3, true)); this.timerNumber = 4; assertThrows(NoSuchElementException.class, () -> this.tlogic.getTimer(this.timerNumber)); }