void (@NotNull Executor executor, final @NotNull ResultConsumer<? super V> consumer) { myFuture.addListener(() -> { try { final V result = myFuture.get(); consumer.onSuccess(result); } catch (ExecutionException e) { consumer.onFailure(e.getCause()); } catch (Throwable throwable) { consumer.onFailure(throwable); } }, executor); }