@Test public void testRunnableResponse() throws ExecutionException, InterruptedException { ListenableFutureTask<Boolean> futureTask = ListenableFutureTask.create(new Runnable() { @Override public void run() { try { Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } } }, true); futureTask.run(); Boolean result = futureTask.get(); assertThat(result, is(true)); }
public static <V> ListenableFutureTask<V> create(Callable<V> callable) { return new ListenableFutureTask<V>(callable); }
ListenableFutureTask extends FutureTask<V> implements ListenableFuture<V> { public static <V> ListenableFutureTask<V> create(Callable<V> callable) { return new ListenableFutureTask<V>(callable); } }
ListenableFutureTask extends FutureTask<V> implements ListenableFuture<V> { public static <V> ListenableFutureTask<V> create(Callable<V> callable) { return new ListenableFutureTask<V>(callable); } ListenableFutureTask(Callable<V> callable);   ListenableFutureTask(Runnable runnable, V result); }
ListenableFutureTask extends FutureTask<V> implements ListenableFuture<V> { public static <V> ListenableFutureTask<V> create(Callable<V> callable) { return new ListenableFutureTask<V>(callable); } ListenableFutureTask(Callable<V> callable);   ListenableFutureTask(Runnable runnable, V result); static ListenableFutureTask<V> create(Callable<V> callable); static ListenableFutureTask<V> create(
            Runnable runnable, V result); @Override void addListener(Runnable listener, Executor exec); @Override void addListener(Runnable listener); }
ListenableFutureTask extends FutureTask<V> implements ListenableFuture<V> { public static <V> ListenableFutureTask<V> create(Callable<V> callable) { return new ListenableFutureTask<V>(callable); } ListenableFutureTask(Callable<V> callable);   ListenableFutureTask(Runnable runnable, V result); static ListenableFutureTask<V> create(Callable<V> callable); static ListenableFutureTask<V> create(
            Runnable runnable, V result); @Override void addListener(Runnable listener, Executor exec); @Override void addListener(Runnable listener);  }