private static <T> BiConsumer<T, Throwable> completeHandler(CompletableCompletionStage<T> s) {
        return (result, failure) -> {
            if (failure == null) {
                s.complete(result);
            } else {
                handleFailure(s, failure);
            }
        };
    }
private static < T > BiConsumer < T , Throwable > completeHandler ( CompletableCompletionStage < T > s ) { return ( result , failure ) -> { if ( failure == null ) { s . complete ( result ) ; } else { handleFailure ( s , failure ) ; } } ; }
Handler that can be used in whenComplete method.

@return BiConsumer that passes values to this CompletionStage.