title: How to check if all tasks running on ExecutorService are completed
body: <p>I'v got ConcurrentLinkedDeque which I'm using for synchronic push/pop elements, 
  and I'v got some async tasks which are taking one element from stack and if this element has neighbors It's pushing it to stack.</p>
  
  <p>Example code:</p>
  
  <pre><code>private ConcurrentLinkedDeque&lt;Item&gt; stack = new ConcurrentLinkedDeque&lt;&gt;();
  private ExecutorService exec = Executors.newFixedThreadPool(5);
  
      while ((item = stack.pollFirst()) != null) {
                  if (item == null) {
                  } else {
                      Runnable worker = new Solider(this, item);
                      exec.execute(worker);
                  }
              }
  
     class Solider{
           public void run(){
               if(item.hasNeighbors){
                  for(Item item:item.neighbors){
                      stack.push(item)
                  }
               } 
           }
      }
  </code></pre>
  
  <p>I would like to have additional statement in while loop which answers the question - "any task in Executor is working?"</p>