public void checkAndResumePsicquicTasks() {
    List<Future> currentRunningTasks = new ArrayList<Future>(runningTasks);

    for (Future<PsicquicCountResults> f : currentRunningTasks) {
      try {
        PsicquicCountResults results = f.get(threadTimeOut, TimeUnit.SECONDS);

        if (results.isImex()) {
          if (results.isImexResponding() && results.getImexCount() > 0) {
            countInOtherImexDatabases += results.getImexCount();
            otherImexDatabasesWithResults++;
          } else if (!results.isImexResponding()) {
            nonRespondingImexDatabases++;
          }
        }

        if (results.isServiceResponding() && results.getPsicquicCount() > 0) {
          countInOtherDatabases += results.getPsicquicCount();
          otherDatabasesWithResults++;
        } else if (!results.isServiceResponding()) {
          nonRespondingDatabases++;
        }

        runningTasks.remove(f);
      } catch (InterruptedException e) {
        log.error("The psicquic task was interrupted, we cancel the task.", e);
        this.nonRespondingDatabases++;
        this.nonRespondingImexDatabases++;
        if (!f.isCancelled()) {
          f.cancel(false);
        }
        runningTasks.remove(f);
      } catch (ExecutionException e) {
        log.error("The psicquic task could not be executed, we cancel the task.", e);
        if (!f.isCancelled()) {
          f.cancel(false);
        }
        runningTasks.remove(f);
      } catch (TimeoutException e) {
        log.error("Service task stopped because of time out " + threadTimeOut + "seconds.");
        this.nonRespondingDatabases++;
        this.nonRespondingImexDatabases++;

        if (!f.isCancelled()) {
          f.cancel(false);
        }
        runningTasks.remove(f);
      } catch (Throwable e) {
        log.error("The psicquic task could not be executed, we cancel the task.", e);
        if (!f.isCancelled()) {
          f.cancel(false);
        }
        runningTasks.remove(f);
      }
    }
  }