code: public static JobStatusCalculator errorOnLastNumJobsFailed(final String key,
                                                                 final int numJobs,
                                                                 final JobRepository jobRepository,
                                                                 final JobMetaRepository jobMetaRepository,
                                                                 final String managementContextPath
      ) {
          return new JobStatusCalculator(
                  key, numJobs, numJobs - 1, jobRepository, jobMetaRepository, managementContextPath
          );
      }
docs: Builds a JobStatusCalculator that is reporting {@link Status#ERROR} if the last {@code numJobs} job failed.
  
  @param key                   key of the calculator
  @param numJobs               the number of last jobs used to calculate the job status
  @param jobRepository         the repository
  @param jobMetaRepository     meta data to indentify disabled jobs
  @param managementContextPath base path to link to job directly
  @return JobStatusCalculator