Submits a value-returning task for execution and returns a Future representing the pending results of the task.
def executor = java.util.concurrent.Executors.newSingleThreadExecutor()
try {
def future = executor.submit {
return 'works'
}
assert future.get() == 'works'
} finally {
executor.shutdown()
}