### Question:
JobWatcher extends Watcher<V1Job> implements WatchListener<V1Job> { static String getFailedReason(V1Job job) { V1JobStatus status = job.getStatus(); if (status != null && status.getConditions() != null) { for (V1JobCondition cond : status.getConditions()) { if ("Failed".equals(cond.getType()) && "True".equals(cond.getStatus())) { return cond.getReason(); } } } return null; } private  JobWatcher(
      String namespace,
      String initialResourceVersion,
      WatchTuning tuning,
      AtomicBoolean isStopping); static @Nonnull JobWatcher getOrCreateFor(Domain domain); @Override String getNamespace(); static JobWatcher create(
      ThreadFactory factory,
      String ns,
      String initialResourceVersion,
      WatchTuning tuning,
      AtomicBoolean isStopping); static boolean isComplete(V1Job job); @Override WatchI<V1Job> initiateWatch(WatchBuilder watchBuilder); void receivedResponse(Watch.Response<V1Job> item); Step waitForReady(V1Job job, Step next);  }### Answer:
@Test public void whenJobHasFailedReason_getFailedReasonReturnsIt() { setFailedWithReason(cachedJob, "AReason"); assertThat(JobWatcher.getFailedReason(cachedJob), is("AReason")); }
@Test public void whenJobHasNoFailedReason_getFailedReasonReturnsNull() { setFailedWithReason(cachedJob, null); assertThat(JobWatcher.getFailedReason(cachedJob), nullValue()); }
@Test public void whenJobHasNoFailedCondition_getFailedReasonReturnsNull() { cachedJob.status(new V1JobStatus().addConditionsItem(createCondition("Complete"))); assertThat(JobWatcher.getFailedReason(cachedJob), nullValue()); }
@Test public void whenJobHasNoJobCondition_getFailedReasonReturnsNull() { cachedJob.status(new V1JobStatus().conditions(Collections.emptyList())); assertThat(JobWatcher.getFailedReason(cachedJob), nullValue()); }