Alright, possible a naive question here. I have a service that needs to log into multiple network devices, run a command on each and collect the results. For speed, rather
public List getCommandResults(String command) {
FutureTask task = new FutureTask(new CommandTask(command))
taskExecutor.execute(task);
return task.get(); //or task.get(); return commandResults; - but it not a good practice
}