1. public static final ExecutorService executor = Executors.newFixedThreadPool(10);
    2. ArrayList<Future<String>> futures = new ArrayList<>();
    3. for(int l=0;l<10;l++){
    4. start = end;
    5. end = end+totRouteNode.size()/10;
    6. if(l==9){
    7. end = totRouteNode.size();
    8. }
    9. Future<String> stringFuture = GA.executor.submit(new PrintIndentify(totRouteNode,routeNode,start,end));
    10. futures.add(stringFuture);
    11. }
    12. for(int l=0;l<10;l++){
    13. try {
    14. result = result + futures.get(l).get();
    15. } catch (InterruptedException e) {
    16. e.printStackTrace();
    17. } catch (ExecutionException e) {
    18. e.printStackTrace();
    19. }
    20. }