code: public static void checkAllDone(Collection<Future> futures) throws Exception {
          for (Future f : futures) {
              if (f.isDone()) {
                  f.get();
              }
          }
      }
docs: Rethrow exeception of the fist future that completed with an exception
  
  @param futures
  @throws Exception