guava/src/com/google/common/util/concurrent/Futures.java
public static <V> ListenableFuture<V> immediateFailedFuture(Throwable throwable) {
    checkNotNull(throwable);
    return new ImmediateFailedFuture<V>(throwable);
  }
public static <V> ListenableFuture<V> immediateFailedFuture(Throwable throwable) {
    checkNotNull(throwable);
    return new ImmediateFailedFuture<V>(throwable);
  }
Returns a {@code ListenableFuture} which has an exception set immediately upon construction.

<p>The returned {@code Future} can't be cancelled, and its {@code isDone()} method always
returns {@code true}. Calling {@code get()} will immediately throw the provided {@code
Throwable} wrapped in an {@code ExecutionException}.