### Question:
FxAsync { public static <T> CompletionStage<T> doOnFxThread(final T element, final Consumer<T> action) { return CompletableFuture.supplyAsync(() -> { action.accept(element); return element; }, Platform::runLater); } private  FxAsync(); static CompletionStage<T> doOnFxThread(final T element, final Consumer<T> action); static CompletionStage<U> computeOnFxThread(final T element, final Function<T, U> compute);  }### Answer:
@Test public void doOnFxThread() throws ExecutionException, InterruptedException { FxAsync.doOnFxThread( fxThread, expected -> assertThat(Thread.currentThread()).isEqualTo(expected) ).toCompletableFuture().get(); }