ThriftListenableFuture extends AbstractFuture<T> implements AsyncMethodCallback<T> { public static <T> ThriftListenableFuture<T> completedFuture(@Nullable T value) { final ThriftListenableFuture<T> future = new ThriftListenableFuture<>(); future.onComplete(value); return future; }  static ThriftListenableFuture<T> completedFuture(@Nullable T value); static ThriftListenableFuture<T> exceptionallyCompletedFuture(Throwable cause); @Override void onComplete(@Nullable T value); @Override void onError(Exception cause);  }
@Test void testSuccessfulListenableFuture() throws Exception { assumeUnshadedGuava(); final ThriftListenableFuture<String> future = completedFuture("success"); assertThat(future.get()).isEqualTo("success"); }