title: Java 8 Running Multiple Methods In Parallel
body: <p>I have 2 methods that have different return types that I want to run at the same time. Here is my code:</p>
  
  <pre><code>public void method(int id) {
      final CompletableFuture&lt;List&lt;FooA&gt;&gt; fooACF = CompletableFuture.supplyAsync(() -&gt; generateFooA(id));
      final CompletableFuture&lt;List&lt;FooB&gt;&gt; fooBCF = CompletableFuture.supplyAsync(() -&gt; generateFooB(id));
      List&lt;FooA&gt; fooAs = fooACF.get();
      List&lt;FooB&gt; fooBs = fooBCF.get();
      //Do more processesing
  }
  
  public List&lt;FooA&gt; generateFooA(int id) {
      //code
  }
  
  public List&lt;FooB&gt; generateFooB(int id) {
      //code
  }
  </code></pre>
  
  <p>But I don't know if both methods will run in parallel with the above code or if I'm just better off saying:</p>
  
  <pre><code>List&lt;FooA&gt; fooAs = generateFooA(id);
  List&lt;FooB&gt; fooBs = generateFooB(id);
  </code></pre>
  
  <p>How do I use completeable futures properly to be able to run both methods in parallel?</p>