### Question:
QueueServiceImpl implements QueueService { boolean shouldBuild(Repository repository, String sha1, boolean force) { if (force) return true; return shouldBuild(statusService.getStatus(repository, sha1)); } @Inject  QueueServiceImpl(Context context, StatusesService statusService, Pipeline pipeline,
			BuildTaskProvider builder); @Override Future<BuildResult> enqueueBuild(UserIdentity committer, Repository repository,
			String sha1, String command, boolean force); @Override void addCallback(BuildLifeCycleListener callback); @Override void removeCallback(BuildLifeCycleListener callback); @Override Collection<Pair<Repository, String>> getCurrentTasks(); @Override Collection<Pair<Repository, String>> getScheduledTasks();  }### Answer:
@Test public void testShouldBuild() throws Exception { assertThat(buildQueueServiceImpl.shouldBuild(Arrays.asList(ERROR))).isTrue(); assertThat(buildQueueServiceImpl.shouldBuild(Arrays.asList(OK, ERROR))).isTrue(); assertThat(buildQueueServiceImpl.shouldBuild(Arrays.asList(NEW))).isTrue(); }
@Test public void testShouldntBuild() throws Exception { assertThat(buildQueueServiceImpl.shouldBuild(Arrays.asList(OK))).isFalse(); assertThat(buildQueueServiceImpl.shouldBuild(Arrays.asList(ERROR, OK))).isFalse(); assertThat(buildQueueServiceImpl.shouldBuild(Arrays.asList(PENDING))).isFalse(); assertThat(buildQueueServiceImpl.shouldBuild(Arrays.asList(RUNNING))).isFalse(); assertThat(buildQueueServiceImpl.shouldBuild(Arrays.asList(ERROR, PENDING))).isFalse(); assertThat(buildQueueServiceImpl.shouldBuild(Arrays.asList(ERROR, RUNNING))).isFalse(); }