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());
}

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 ( ) ) ; }
consume returns a completablefuture that is done when publisher completes
