@Test(dataProvider="createTimer")
    public void testSchedulingTasksThenCancellingEverySecondTask(TimeScheduler timer) {
        final int NUM=20;

        Future<?>[] futures=new Future<?>[NUM];

        try {
            for(int i=0; i < NUM; i++) {
                futures[i]=timer.schedule(new MyRunnable(i), 1000, TimeUnit.MILLISECONDS);
                if(i % 2 == 0)
                    futures[i].cancel(false);
            }

            Util.sleep(3000);

            for(int i=0; i < NUM; i++) {
                Future<?> future=futures[i];
                System.out.println("[" + i + "] done=" + future.isDone() + ", cancelled=" + future.isCancelled());
            }

            for(int i=0; i < NUM; i++) {
                Future<?> future=futures[i];
                assert future.isDone();
                if(i % 2 == 0)
                    assert future.isCancelled();
                else
                    assert !future.isCancelled();
            }
        }
        finally {
            timer.stop();
        }
    }