Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
import java.util.concurrent.Executors;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
List<Future<T>> a;
try (ExecutorService executorService = Executors.newFixedThreadPool(3)) {
a = executorService.invokeAll(List.of(f1, f2, f3));
}
T a1 = a.get(0).get();
T a2 = a.get(1).get();
T a3 = a.get(2).get();