public List<JobInfo> findJobs(final Optional<String> type,final int count){
  if (type.isPresent()) {
    return repository.findLatestBy(type.get(),count);
  }
 else {
    return repository.findLatest(count);
  }
}

public List < JobInfo > findJobs ( final Optional < String > type , final int count ) { if ( type . isPresent ( ) ) { return repository . findLatestBy ( type . get ( ) , count ) ; } else { return repository . findLatest ( count ) ; } }
find the latest jobs , optionally restricted to jobs of a specified type .
