@Test public void canGetImmediateResult() throws ExecutionException, InterruptedException { Object result = mock(Object.class); Future<Object> future = Futures.immediateFuture(result); assertThat(future.get()).isSameInstanceAs(result); }
@Override @Nullable public abstract V get() throws ExecutionException;
ImmediateFuture implements ListenableFuture<V> { @Override @Nullable public abstract V get() throws ExecutionException; }
ImmediateFuture implements ListenableFuture<V> { @Override @Nullable public abstract V get() throws ExecutionException;  }
ImmediateFuture implements ListenableFuture<V> { @Override @Nullable public abstract V get() throws ExecutionException;  static ListenableFuture<V> nullFuture(); @Override void addListener(@NonNull Runnable listener, @NonNull Executor executor); @Override boolean cancel(boolean mayInterruptIfRunning); @Override boolean isCancelled(); @Override boolean isDone(); @Override @Nullable abstract V get(); @Override @Nullable V get(long timeout, @NonNull TimeUnit unit); }
ImmediateFuture implements ListenableFuture<V> { @Override @Nullable public abstract V get() throws ExecutionException;  static ListenableFuture<V> nullFuture(); @Override void addListener(@NonNull Runnable listener, @NonNull Executor executor); @Override boolean cancel(boolean mayInterruptIfRunning); @Override boolean isCancelled(); @Override boolean isDone(); @Override @Nullable abstract V get(); @Override @Nullable V get(long timeout, @NonNull TimeUnit unit);  }