void () { Alarm alarm = new Alarm(); StringBuilder sb = new StringBuilder(); alarm.addRequest(() -> sb.append("1"), 0, ModalityState.nonModal()); alarm.addRequest(() -> sb.append("2"), 5, ModalityState.nonModal()); assertEquals("", sb.toString()); alarm.drainRequestsInTest(); assertEquals("12", sb.toString()); }