core/src/test/java/org/infinispan/test/AbstractInfinispanTest.java
/**
    * This will run the various callables at approximately the same time by ensuring they all start before
    * allowing the callables to proceed.  The callables may not be running yet at the offset of the return of
    * the completion service.
    *
    * This method doesn't allow distinction between which Future applies to which Callable.  If that is required
    * it is suggested to use {@link AbstractInfinispanTest#completionService()} and retrieve the future
    * directly when submitting the Callable while also wrapping your callables in something like
    * {@link org.infinispan.test.AbstractInfinispanTest.ConcurrentCallable} to ensure your callables will be invoked
    * at approximately the same time.
    * @param tasks The callables to run.  Note the type isn't provided since it is difficult
    * @param <V> The type of callables
    * @return The completion service that can be used to query when a callable completes
    */
This will run the various callables at approximately the same time by ensuring they all start before
allowing the callables to proceed.  The callables may not be running yet at the offset of the return of
the completion service.

This method doesn't allow distinction between which Future applies to which Callable.  If that is required
it is suggested to use  AbstractInfinispanTest#completionService() and retrieve the future
directly when submitting the Callable while also wrapping your callables in something like
org.infinispan.test.AbstractInfinispanTest.ConcurrentCallable to ensure your callables will be invoked
at approximately the same time.
@param tasks The callables to run.  Note the type isn't provided since it is difficult
@param  The type of callables
@return The completion service that can be used to query when a callable completes
This will run the various callables at approximately the same time by ensuring they all start before allowing the callables to proceed . The callables may not be running yet at the offset of the return of the completion service . This method doesn ' t allow distinction between which Future applies to which Callable . If that is required it is suggested to use AbstractInfinispanTest#completionService () and retrieve the future directly when submitting the Callable while also wrapping your callables in something like org . infinispan . test . AbstractInfinispanTest . ConcurrentCallable to ensure your callables will be invoked at approximately the same time . @param tasks The callables to run . Note the type isn ' t provided since it is difficult @param The type of callables @return The completion service that can be used to query when a callable completes
protected <V> CompletionService<V> runConcurrentlyWithCompletionService(Callable[] tasks) {
      if (tasks.length == 0) {
         throw new IllegalArgumentException("Provided tasks array was empty");
      }
      CompletionService<V> completionService = completionService();
      CyclicBarrier barrier = new CyclicBarrier(tasks.length);
      for (Callable task : tasks) {
         completionService.submit(new ConcurrentCallable<>(new LoggingCallable<V>(task), barrier));
      }
      return completionService;
   }
protected < V > CompletionService < V > runConcurrentlyWithCompletionService ( Callable [ ] tasks ) { if ( tasks . length == 0 ) { throw new IllegalArgumentException ( "Provided tasks array was empty" ) ; } CompletionService < V > completionService = completionService ( ) ; CyclicBarrier barrier = new CyclicBarrier ( tasks . length ) ; for ( Callable task : tasks ) { completionService . submit ( new ConcurrentCallable < > ( new LoggingCallable < V > ( task ) , barrier ) ) ; } return completionService ; }
This will run the various callables at approximately the same time by ensuring they all start before
 allowing the callables to proceed.
This will run the various callables at approximately the same time by ensuring they all start before allowing the callables to proceed .