title: How to collect return values of methods in several Threads
body: <p>I'm starting a new Thread for every Object in a list and invoking a method on those. The method I invoke returns a value which I want to save like that:</p>
  
  <pre><code>public int[] benchAll(){
      int[] numbers = new int[things.size()];
      for (final Thing thing: things) {
              final Generator generator = new Generator();
  
              new Thread(
                  () -&gt; generator.benchmark(thing)
              ).start();
              generators.add(generator);
          }
      return numbers;
      }
  </code></pre>
  
  <p>Now how can I save every return value of <code>benchmark()</code> in the other Threads to return it with this method <code>benchAll()</code>?</p>
  
  <p>Your help'd be appreciated.</p>