title: how future get() method works with timeout
body: <p>I am a bit confused how Future.get(timeout) works as per the definition it would through an exception after specified timeout time, but its not happening in my test cases.</p>
  
  <pre><code>import java.util.LinkedHashSet;
  import java.util.Set;
  import java.util.concurrent.Callable;
  import java.util.concurrent.ExecutorService;
  import java.util.concurrent.Executors;
   import java.util.concurrent.Future;
  import java.util.concurrent.TimeUnit;
  
  public class CallableExample {
  
  public static class WordLengthCallable implements Callable&lt;String&gt; {
      private String word;
      private long waiting;
  
      public WordLengthCallable(String word, long waiting) {
          this.word = word;
          this.waiting = waiting;
      }
  
      public String call() throws InterruptedException {
          Thread.sleep(waiting);
          return word;
      }
  }
  
  public static void main(String args[]) throws Exception {
      args = new String[] { "i", "am", "in", "love" };
      long[] waitArr = new long[] { 3000, 3440, 2500, 3000 };
      ExecutorService pool = Executors.newFixedThreadPool(3);
      Set&lt;Future&lt;String&gt;&gt; set = new LinkedHashSet&lt;Future&lt;String&gt;&gt;();
      int i = 0;
      for (String word : args) {
          Callable&lt;String&gt; callable = new WordLengthCallable(word, waitArr[i++]);
          Future&lt;String&gt; future = pool.submit(callable);
          set.add(future);
      }
      String sum = "";
      for (Future&lt;String&gt; future : set) {
          try {
              sum += future.get(2000, TimeUnit.MILLISECONDS) + ", ";
          } catch (Exception e) {
          }
      }
      System.out.print("Result : " + sum);
  }
  }
  </code></pre>
  
  <p>output "am, in,"</p>
  
  <p>it behaves differently on changing waiting time in array( timeArr values). when to use get with timeout?</p>