Javadoc
Implementation to modify a provided task. The provided runnable will be the one submitted to
the Executor, unless a
Callable was submitted, in which case a
ListenableFutureTask will be provided. In the last condition the original callable
can be retrieved by invoking
ListenableFutureTask#getContainedCallable(). The returned
task can not be null, but could be either the original task, a modified task, a wrapper to the
provided task, or if no action is desired
org.threadly.concurrent.DoNothingRunnable#instance() may be provided. However caution
should be used in that if a
ListenableFutureTask is provided, and then never returned
(and not canceled), then the future will never complete (and thus possibly forever blocked).
So if you are doing conditional checks for
ListenableFutureTask and may not
execute/return the provided task, then you should be careful to ensure
ListenableFutureTask#cancel(boolean) is invoked.