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