assertEquals(0, alarmClock.getCount()) ;
}
@Test public void alarm_03()
{
AlarmClock alarmClock = new AlarmClock() ;
assertEquals(0, alarmClock.getCount()) ;
Pingback<?> ping1 = alarmClock.add(callback, 100) ;
Pingback<?> ping2 = alarmClock.add(callback, 100000) ;
assertEquals(2, alarmClock.getCount()) ;
sleep(200) ;
// ping1 went off.
assertEquals(1, alarmClock.getCount()) ;
alarmClock.cancel(ping1) ;
assertEquals(1, alarmClock.getCount()) ;
alarmClock.cancel(ping2) ;
assertEquals(0, alarmClock.getCount()) ;
}