### Question:
TimerSpeech { @Intent public String setTimer(Map<String, EntityData> entities) { int hours = 0; int minutes = 0; int seconds = 0; if (entities.get("hour") != null) { hours = entities.get("hour").getNumber(); } if (entities.get("minute") != null) { minutes = entities.get("minute").getNumber(); } if (entities.get("second") != null) { seconds = entities.get("second").getNumber(); } if (hours == 0 && minutes == 0 && seconds == 0) { return "No value is set"; } LocalDateTime timerDate = LocalDateTime.now().plusHours(hours).plusMinutes(minutes).plusSeconds(seconds) .truncatedTo(ChronoUnit.SECONDS); Timer timer = this.timerLogic.setTimer(timerDate); return timerS + timer.getId() + " set"; }  @Intent String setTimer(Map<String, EntityData> entities); @Intent String pauseTimer(Map<String, EntityData> entities); @Intent String reactivateTimer(Map<String, EntityData> entities); @Intent String resetTimerObjects(Map<String, EntityData> entities); @Intent String deleteTimerObject(Map<String, EntityData> entities); @Intent String stopRinging(Map<String, EntityData> entities); @Intent String getTimerObject(Map<String, EntityData> entities); @Intent String getAllTimerObjects(Map<String, EntityData> entities); @Intent String getRemainingTimerDelay(Map<String, EntityData> entities);  }### Answer:
@Test public void setTimerTest() { Map<String, EntityData> map = new HashMap<>(); when(this.hour.getNumber()).thenReturn(1); when(this.minute.getNumber()).thenReturn(5); when(this.second.getNumber()).thenReturn(30); map.put("hour", this.hour); map.put("minute", this.minute); map.put("second", this.second); LocalDateTime timerDate = LocalDateTime.now().plusHours(this.hour.getNumber()) .plusMinutes(this.minute.getNumber()).plusSeconds(this.second.getNumber()) .truncatedTo(ChronoUnit.SECONDS); Timer t = new Timer(1, timerDate, null, true); when(this.tLogic.setTimer(timerDate)).thenReturn(t); assertThat(this.tSpeech.setTimer(map), is("Timer 1 set")); }
@Test public void setTimerInvalidTest() { Map<String, EntityData> map = new HashMap<>(); when(this.hour.getNumber()).thenReturn(0); when(this.minute.getNumber()).thenReturn(0); when(this.second.getNumber()).thenReturn(0); map.put("hour", this.hour); map.put("minute", this.minute); map.put("second", this.second); assertThat(this.tSpeech.setTimer(map), is("No value is set")); }