### Question:
JobExecutor { public final void scheduleJob(final Job<?> job) { if (state != State.RUNNING) { throw new IllegalStateException("Cannot schedule new job on a JobExecutor that has" + " been shut down."); } runningJobs.add(job); job.submitTasks(executorService, new Callable<Void>() { @Override public Void call() throws Exception { runningJobs.remove(job); return null; } }); } JobExecutor();  JobExecutor(final int threadCountMultiplier); final void scheduleJob(final Job<?> job); final State getState(); @SuppressFBWarnings( value = "SWL_SLEEP_WITH_LOCK_HELD", justification = "No resources are being consumed or waited on; reentrant threads should" + "remain locked out while .") final synchronized void shutdown(); final void shutdownNow();  }### Answer:
@Test(expectedExceptions = IllegalStateException.class) public final void testGetResultsJobNotFinished() { List<Callable<Void>> tasks = new ArrayList<>(); tasks.add(longTask); Job<Void> job = new Job<>(tasks); jobExecutor.scheduleJob(job); job.getResults(longTask); }
@Test(expectedExceptions = IllegalStateException.class) public final void testGetFailuresJobNotFinished() { List<Callable<Integer>> tasks = new ArrayList<>(); tasks.add(incrementTask); Job<Integer> job = new Job<>(tasks); jobExecutor.scheduleJob(job); job.getFailures(incrementTask); }
@Test(expectedExceptions = IllegalStateException.class) public final void testGetAllFailuresJobNotFinished() { List<Callable<Integer>> tasks = new ArrayList<>(); tasks.add(incrementTask); Job<Integer> job = new Job<>(tasks); jobExecutor.scheduleJob(job); job.getAllFailures(); }