ExecutorService pool=Executors.newFixedThreadPool(7);
List> future=new ArrayList>();
List<
invokeAll is a blocking method. It means – JVM won’t proceed to next line until all the threads are completed. So I think there is something wrong with your thread future result.
System.out.println("name is:"+future.get(i).get().getName());
from this line I think there are some futures have no result and can be null, So you should check your code, if there are some Futures null,If so, get a if before this line executed.