title: Terminate other Future tasks running in when condition is met in one for the Future Task
body: <p>Using java 8</p>
  
  <p>I'm trying to write a prog to download log files from diff servers and search a given text in these log files. I'm doing is synchronously right now. I want to do it in parallel and found out that it can be done using Future in java. I'm using apache.commons.io for downloading file from URL. 
  Here is code snippet:</p>
  
  <pre><code>ExecutorService executorService = Executors.newCachedThreadPool();
      List&lt;Future&lt;XCluster&gt;&gt; clusterFutures = new ArrayList&lt;&gt;();
      for(XCluster cluster: clusters) {
          clusterFutures.add(executorService.submit(() -&gt;  {
              return downloadAndSearch(textToSearch, cluster);
          }));
      }
      //For now I'm not doing anything with returned value from Future
  </code></pre>
  
  <p>But now I want to terminate other download-search operation started under Future as given search is expected to be found in only one of the servers. So there is no need to continue on other Future tasks which I started. can any one suggest a way to do this? I'm using java 8, other options are also welcome. Thanks In Advance!</p>