code: public StatusDetail statusDetail(final JobDefinition jobDefinition) {
          try {
              final List<JobInfo> jobs = jobRepository.findLatestBy(jobDefinition.jobType(), numberOfJobs + 1);
              return jobs.isEmpty()
                      ? statusDetailWhenNoJobAvailable(jobDefinition)
                      : toStatusDetail(jobs, jobDefinition);
          } catch (final Exception e) {
              LOG.error(LOAD_JOBS_EXCEPTION_MESSAGE + ": " + e.getMessage(), e);
              return StatusDetail.statusDetail(jobDefinition.jobName(), ERROR, LOAD_JOBS_EXCEPTION_MESSAGE);
          }
      }
docs: Returns a StatusDetail for a JobDefinition. The Status of the StatusDetail is calculated using
  the last job executions and depends on the configuration of the calculator.
  
  @param jobDefinition definition of the job to calculate.
  @return StatusDetail of job executions of the {@link JobDefinition#jobType()}