public static Map<Integer, List<Double>> robustnessParallel(Map<Server, Set<Application>> connections, int runs, int direction, int type) {
        Map<Integer, List<Double>> result = new HashMap<>();
        ExecutorService es = Executors.newCachedThreadPool();
        List<Callable<List<Double>>> callables = new ArrayList<>();
        switch (type) {
            case RANDOM_EXTINCTION:
                for (int i = 0; i < runs; i++) {
                    callables.add(() -> robustnessRandom(connections, direction));
                }
                break;
            case SERVICE_EXTINCTION:
                for (int i = 0; i < runs; i++) {
                    callables.add(() -> robustnessService(connections));
                }
                break;
            default:
                for (int i = 0; i < runs; i++) {
                    callables.add(() -> robustnessRandom(connections, direction));
                }
                break;
        }
        try {
            int index = 0;
            for (Future<List<Double>> future : es.invokeAll(callables)) {
                result.put(index, future.get());
                index++;
            }
        } catch (InterruptedException | ExecutionException e) {
            e.printStackTrace();
        }
        es.shutdown();
        return result;
    }