public static void scheduleWithFixedDelayTest() throws ExecutionException, InterruptedException {
        //*1
        ScheduledExecutorService service= Executors.newScheduledThreadPool(2);
        //*2
        Runnable task1=new Runnable()
        {
            public void run()
            {
                System.out.println("Taskrepeating.");
            }
        };
        //*3
        final ScheduledFuture future1=service.scheduleWithFixedDelay(task1,0,10,TimeUnit.SECONDS);
        //*4
        ScheduledFuture future2=service.schedule(new Callable()
        {
            public String call() throws InterruptedException {
                future1.cancel(true);
                return "taskcancelled!";
            }
        },5, TimeUnit.SECONDS);
        System.out.println(future2.get());
        //*5
        service.shutdown();
    }