title: Executor Does Not Return 10 Future Objects
body: <p>I have an executor service with a Thread Pool of 10 and I expected that I would get 10 print out statements separated by three seconds, but I only receive one print out statement. I passed 10 as the parameter so I was expecting 10 threads to be running. How can I retrieve the 10 future objects?</p>
  
  <pre><code>public class Demo {
      private static final ExecutorService executor = Executors.newFixedThreadPool(10);
  
      public static void main (String[] args) throws ExecutionException, InterruptedException {
  
          ArrayList futureObjects = new ArrayList();
  
          Callable&lt;Integer&gt; task = () -&gt; {
              try {
                  TimeUnit.SECONDS.sleep(3);
                  return 123;
              }
              catch (InterruptedException e) {
                  throw new IllegalStateException("task interrupted", e);
              }
          };
  
          System.out.println("Before execution of threads");
  
          Future&lt;Integer&gt; future = executor.submit(task);
  
          Integer result = future.get();
          futureObjects.add(future.get());
  
          System.out.println("result: " + result);
  
          for(Object futures : futureObjects ){
              System.out.println("Futures in ArrayList: " + futures);
          }
      }
  
  }
  </code></pre>
  
  <p><strong>The output I get is:</strong></p>
  
  <p>Before execution of threads</p>
  
  <p>result: 123</p>
  
  <p>Futures in ArrayList: 123</p>