public static void main(String[] args) throws InterruptedException {
        List<FutureTask<Integer>> list = new ArrayList<FutureTask<Integer>>(
                Arrays.asList(new FutureTask<Integer>(new WordLengthCallable()),
                new FutureTask<Integer>(new WordLengthCallable()),
                new FutureTask<Integer>(new WordLengthCallable()),
                new FutureTask<Integer>(new WordLengthCallable()))
        );
        for (FutureTask<Integer> elem: list) {
            new Thread(elem).start();
        }
        int sum = 0;
        for (FutureTask<Integer> elem: list) {
            try {
                sum += elem.get().intValue();
            } catch (ExecutionException e) {
                e.printStackTrace();
            }
        }
        System.out.println("Result = " + sum);
        System.exit(0);
    }