### Question:
AlarmClockLogic implements RunnableService { protected Alarm setAlarm(int tomorrow, int hour, int minute) { if (Alarm.timeValid(hour, minute)) { tomorrowCheck(tomorrow, hour, minute); int id = searchAlarmId(); Alarm alarm = new Alarm(id, this.alarmTime, true); this.alarmStorage.save(alarm); Runnable alarmRunnable = createAlarmRunnable(id); ZonedDateTime with = this.environment.getCurrentDateTime().with(alarm.getAlarmTime()); if (with.isBefore(this.environment.getCurrentDateTime())) { with = with.plusDays(1); } this.taskScheduler.schedule(alarmRunnable, with.toInstant()); return alarm; } throw new IllegalArgumentException(); }  String stopRinging(); @Override void start(); @Override void stop();  }### Answer:
@Test public void testSetAlarm() { when(this.env.getCurrentDateTime()).thenReturn(ZonedDateTime.of(2018, 2, 1, 4, 21, 55, 987, ZoneId.of("Z"))); this.acl.setAlarm(1, 4, 20); verify(this.scheduler).schedule(ArgumentMatchers.any(Runnable.class), ArgumentMatchers.any(Instant.class)); }
@Test public void testSetAlarmInvalid() { assertThrows(IllegalArgumentException.class, () -> this.acl.setAlarm(1, 12, 60)); assertThrows(IllegalArgumentException.class, () -> this.acl.setAlarm(1, 24, 40)); }