Looks very verbose, but you can try the following. The runAsync() method will make the list chunks run in parallel.
private void test(List
I ran it for a list of 30 integers, with a chunk size of 5 like this:
public static void main(String[] args) throws ExecutionException, InterruptedException {
List list = IntStream.range(0, 30).mapToObj(i1 -> (Object) String.valueOf(i1)).collect(Collectors.toList());
int chunkSize = 5;
new Test().test(list, chunkSize);
}