/*
* Wait tasks termination (limit waiting to 15 minutes) and then display
* processing state
*/
boolean terminationState = taskExecutor.awaitTermination(15, TimeUnit.MINUTES);
if (terminationState) {
System.out.println("All tasks have finished their processing under the timeout !");
} else {
System.out.println("All tasks do not have finished their processing until the timeout !");
}