public static < T > CompletableFuture < T > completedFutureAsync ( T result , Executor executor ) { CompletableFuture < T > future = new CompletableFuture <> ( ) ; executor . execute ( ( ) -> future . complete ( result ) ) ; return future ; }
Creates a future that is asynchronously completed .