An update with test:
Output:
Completed: Task B,0
Completed: Task C,0
Completed: Task A,0
Completed: Task B,1
Completed: Task C,1
Completed: Task A,1
Completed: Task B,2
Completed: Task C,2
Completed: Task A,2
Task A,3 failed with reason: java.lang.Exception: Whatever!
Task A,4 failed with reason: java.lang.Exception: Whatever!
Task A,5 failed with reason: java.lang.Exception: Whatever!
Task A,6 failed with reason: java.lang.Exception: Whatever!
Task A,7 failed with reason: java.lang.Exception: Whatever!
Task A,8 failed with reason: java.lang.Exception: Whatever!
Task A,9 failed with reason: java.lang.Exception: Whatever!
Completed: Task C,3
Completed: Task B,3
Completed: Task B,4
Completed: Task C,4
Completed: Task C,5
Completed: Task B,5
Task B,6 was cancelled.
Task B,7 failed with reason: java.util.concurrent.CancellationException
Task B,8 failed with reason: java.util.concurrent.CancellationException
Task B,9 failed with reason: java.util.concurrent.CancellationException
Completed: Task C,6
Completed: Task C,7
Completed: Task C,8
Completed: Task C,9