public List<BackgroundJob> getRecentJobs() {
   List<BackgroundJob> recent = Lists.newArrayListWithCapacity(backgroundJobs.size());
   ListIterator<BackgroundJob> jobs = backgroundJobs.listIterator();
   while (jobs.hasNext()) {
     BackgroundJob job = jobs.next();
     recent.add(job); // inactive jobs get to be returned once...
     if (job.getFuture().isDone() || job.getFuture().isCancelled()) {
       jobs.remove();
     }
   }
   return recent;
 }