code: public List<JobInfo> findJobs(final Optional<String> type, final int count) {
          if (type.isPresent()) {
              return jobRepository.findLatestBy(type.get(), count);
          } else {
              return jobRepository.findLatest(count);
          }
      }
docs: Find the latest jobs, optionally restricted to jobs of a specified type.
  
  @param type  if provided, the last N jobs of the type are returned, otherwise the last jobs of any type.
  @param count the number of jobs to return.
  @return a list of JobInfos