package org.helioviewer.jhv.threads;

import java.util.concurrent.FutureTask;

public class CancelTask extends FutureTask<Void> {

    public CancelTask(FutureTask<?> abolishTask) {
        super(new Runnable() {
                private FutureTask<?> abolishTask;

                public Runnable init(FutureTask<?> abolishTask) {
                    this.abolishTask = abolishTask;
                    return this;
                }

                @Override
                public void run() {
                    abolishTask.cancel(true);
                }
            }.init(abolishTask), null);
    }

}

@@ -31,16 +31,54 @@
 reads;%0A%0A
+import java.util.concurrent.Callable;%0A
 import j
@@ -157,12 +157,15 @@
 ask%3C
-Void
+Boolean
 %3E %7B%0A
@@ -193,39 +193,38 @@
 k(FutureTask%3C?%3E 
-abolish
+cancel
 Task) %7B%0A        
@@ -233,24 +233,33 @@
 per(new 
-Runnable
+Callable%3CBoolean%3E
 () %7B%0A   
@@ -289,31 +289,31 @@
 tureTask%3C?%3E 
-abolish
+_cancel
 Task;%0A%0A     
@@ -334,12 +334,12 @@
 lic 
-Runn
+Call
 able
@@ -358,23 +358,23 @@
 Task%3C?%3E 
-abolish
+_cancel
 Task) %7B%0A
@@ -402,29 +402,29 @@
 his.
-abolishTask = abolish
+_cancelTask = _cancel
 Task
@@ -530,16 +530,20 @@
 lic 
-void run
+Boolean call
 () %7B
@@ -563,23 +563,30 @@
         
-abolish
+return _cancel
 Task.can
@@ -637,26 +637,19 @@
 nit(
-abolishTask), null
+cancelTask)
 );%0A 

Use Callable to be able to retrieve the result of cancel