### Question:
AlarmManager extends AbstractStartable implements Runnable { public synchronized void remove( AlarmListener listener ) { checkIsStarted(); Alarm alarm = removeAlarm( listener ); if (alarm != null) { dequeue( alarm ); notifyWorker( "remove" ); } } AlarmManager( int nWorkers );  AlarmManager(); static void staticAdd( AlarmListener listener, Object state, int delay ); static void staticRemove( AlarmListener listener ); static AlarmManager getAlarmManager( boolean startIt ); static AlarmManager setAlarmManager( AlarmManager newAlarmManager ); synchronized void add( AlarmListener listener, Object state, int delay ); synchronized void remove( AlarmListener listener ); void run(); static void shutdown(); final static int DEFAULT_NWORKERS; }### Answer:
@Test( expected = IllegalStateException.class ) public void remove1() throws Exception { AlarmManager am = new AlarmManager(); am.remove( listener ); }
@Test public void remove2() throws Exception { AlarmManager am = new AlarmManager(); am.start(); am.remove( listener ); }