JobExecutor implements AutoCloseable { public JobReport execute(Job job) { try { return executorService.submit(job).get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException("Unable to execute job " + job.getName(), e); } } JobExecutor();  JobExecutor(int nbWorkers);  JobExecutor(ExecutorService executorService); JobReport execute(Job job); Future<JobReport> submit(Job job); List<Future<JobReport>> submitAll(Job... jobs); List<Future<JobReport>> submitAll(List<Job> jobs); void shutdown(); void awaitTermination(long timeout, TimeUnit unit); @Override void close();  }
@Test public void execute() { JobReport actual = jobExecutor.execute(job); assertThat(actual).isEqualTo(report); }