ExecutorService with invokeAll() and Future in java
<p>Having the following code at hand:</p>

<pre><code>    ExecutorService executor = Executors.newFixedThreadPool(10);
    Collection collection = new ArrayList();
    for (int n=1; n&lt;100; n++)
        collection.add(new MyThread(n));

    try {
        List&lt;Future&lt;Boolean&gt;&gt; futures = executor.invokeAll(collection);

        for(Future&lt;Boolean&gt; future : futures){
            future.get();
            if (future.isDone()) {
                System.out.println("true");
            }
            else
                System.out.println("false");
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
</code></pre>

<p>If the above is correct?<br>
And if all <code>future.isDone()</code> are true, then all of the threads have been done?<br>
How can I make a flag, to be sure that all of them are done?</p>
