JobCreatorHolder { public Job createJob(String tag) { Job job = null; boolean atLeastOneCreatorSeen = false; for (JobCreator jobCreator : mJobCreators) { atLeastOneCreatorSeen = true; job = jobCreator.create(tag); if (job != null) { break; } } if (!atLeastOneCreatorSeen) { CAT.w("no JobCreator added"); } return job; } JobCreatorHolder(); void addJobCreator(JobCreator creator); void removeJobCreator(JobCreator creator); Job createJob(String tag); boolean isEmpty();  }
@Test public void createJobLogsWarningWhenNoCreatorsAreAdded() { holder.createJob("DOES_NOT_EXIST"); verify(jobLogger).log( anyInt(), eq("JobCreatorHolder"), eq("no JobCreator added"), ArgumentMatchers.<Throwable>isNull()); }