question: public void testConsume ( ) { AtomicInteger sum = new AtomicInteger ( ) ; SubmissionPublisher < Integer > p = basicPublisher ( ) ; CompletableFuture < Void > f = p . consume ( null ) ; int n = 20 ; for ( int i = 1 ; i <= n ; ++ i ) p . submit ( i ) ; p . close ( ) ; f . join ( ) ; assertEquals ( ( n * ( n + 1 ) ) / 2 , sum . get ( ) ) ; }
target:  consume returns a CompletableFuture that is done when publisher completes