@Test protected void testGetAlarm() { when(this.alarmStorage.getAll()).thenReturn(createAlarms(3, true)); this.alarmNumber = 2; Alarm returnedAlarm = this.acl.getAlarm(this.alarmNumber); assertThat(returnedAlarm.getId(), is(2)); }
protected Alarm getAlarm(int alarmNumber) { for (Alarm a : this.alarmStorage.getAll()) { if (a.getId() == alarmNumber) { return a; } } throw new NoSuchElementException(); }
AlarmClockLogic implements RunnableService { protected Alarm getAlarm(int alarmNumber) { for (Alarm a : this.alarmStorage.getAll()) { if (a.getId() == alarmNumber) { return a; } } throw new NoSuchElementException(); } }
AlarmClockLogic implements RunnableService { protected Alarm getAlarm(int alarmNumber) { for (Alarm a : this.alarmStorage.getAll()) { if (a.getId() == alarmNumber) { return a; } } throw new NoSuchElementException(); }  }
AlarmClockLogic implements RunnableService { protected Alarm getAlarm(int alarmNumber) { for (Alarm a : this.alarmStorage.getAll()) { if (a.getId() == alarmNumber) { return a; } } throw new NoSuchElementException(); }  String stopRinging(); @Override void start(); @Override void stop(); }
AlarmClockLogic implements RunnableService { protected Alarm getAlarm(int alarmNumber) { for (Alarm a : this.alarmStorage.getAll()) { if (a.getId() == alarmNumber) { return a; } } throw new NoSuchElementException(); }  String stopRinging(); @Override void start(); @Override void stop();  }