EventLoopCheckingFuture extends CompletableFuture<T> { public static <U> EventLoopCheckingFuture<U> completedFuture(@Nullable U value) { final EventLoopCheckingFuture<U> future = new EventLoopCheckingFuture<>(); future.complete(value); return future; }  static EventLoopCheckingFuture<U> completedFuture(@Nullable U value); static EventLoopCheckingFuture<U> exceptionallyCompletedFuture(Throwable cause); @Override T get(); @Override T get(long timeout, TimeUnit unit); @Override T join();  }
@Test void completedFuture() { final EventLoopCheckingFuture<String> future = EventLoopCheckingFuture.completedFuture("foo"); assertThat(future).isCompletedWithValue("foo"); }
@Test void completedFutureWithNull() { final EventLoopCheckingFuture<?> future = EventLoopCheckingFuture.completedFuture(null); assertThat(future).isCompletedWithValue(null); }