### Question:
JobComplete implements Predicate<String> { @Inject public JobComplete(CloudStackApi client) { this.client = client; } @Inject  JobComplete(CloudStackApi client); boolean apply(String jobId);  }### Answer:
@Test public void testJobComplete() { AsyncJob<?> job = AsyncJob.builder().id("100") .status(Status.SUCCEEDED).resultCode(ResultCode.SUCCESS).build(); expect((Object) asyncJobClient.getAsyncJob(job.getId())).andReturn(job); replay(client, asyncJobClient); assertTrue(new JobComplete(client).apply(job.getId())); verify(client, asyncJobClient); }