### Question:
AlarmClockLogic implements RunnableService { protected String deleteAlarm(int alarmNumber) { Alarm a = getAlarm(alarmNumber); deactivateAlarm(a.getId()); this.alarmStorage.deleteById(a.getPersistentId()); return this.alarmS + a.getId() + " deleted"; }  String stopRinging(); @Override void start(); @Override void stop();  }### Answer:
@Test protected void testDeleteAlarm() { List<Alarm> returnedAlarms = createAlarms(3, false); this.alarmNumber = 2; when(this.alarmStorage.getAll()).thenReturn(returnedAlarms); assertThat(this.acl.deleteAlarm(2), is("Alarm " + this.alarmNumber + " deleted")); }
@Test protected void testDeleteAlarmNotFound() { assertThrows(NoSuchElementException.class, () -> this.acl.deleteAlarm(4)); }