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 .