public static final ExecutorService executor = Executors.newFixedThreadPool(10);
ArrayList<Future<String>> futures = new ArrayList<>();
for(int l=0;l<10;l++){
start = end;
end = end+totRouteNode.size()/10;
if(l==9){
end = totRouteNode.size();
}
Future<String> stringFuture = GA.executor.submit(new PrintIndentify(totRouteNode,routeNode,start,end));
futures.add(stringFuture);
}
for(int l=0;l<10;l++){
try {
result = result + futures.get(l).get();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
}