code: private void addNewJobs(Set<HudsonJob> jobs, List<HudsonJob> existingJobs, HudsonCollector collector) {
          long start = System.currentTimeMillis();
          int count = 0;
  
          List<HudsonJob> newJobs = new ArrayList<>();
          for (HudsonJob job : jobs) {
              HudsonJob existing = null;
              if (!CollectionUtils.isEmpty(existingJobs) && (existingJobs.contains(job))) {
                  existing = existingJobs.get(existingJobs.indexOf(job));
              }
  
              String niceName = getNiceName(job, collector);
              String environment = getEnvironment(job, collector);
              if (existing == null) {
                  job.setCollectorId(collector.getId());
                  job.setEnabled(false); // Do not enable for collection. Will be enabled when added to dashboard
                  job.setDescription(job.getJobName());
                  if (StringUtils.isNotEmpty(niceName)) {
                      job.setNiceName(niceName);
                  }
                  if (StringUtils.isNotEmpty(environment)) {
                      job.setEnvironment(environment);
                  }
                  newJobs.add(job);
                  count++;
              } else {
                  if (StringUtils.isEmpty(existing.getNiceName()) && StringUtils.isNotEmpty(niceName)) {
                      existing.setNiceName(niceName);
                      hudsonJobRepository.save(existing);
                  }
                  if (StringUtils.isEmpty(existing.getEnvironment()) && StringUtils.isNotEmpty(environment)) {
                      existing.setEnvironment(environment);
                      hudsonJobRepository.save(existing);
                  }
                  if (StringUtils.isEmpty(existing.getInstanceUrl())) {
                      existing.setInstanceUrl(job.getInstanceUrl());
                      hudsonJobRepository.save(existing);
                  }
              }
          }
          //save all in one shot
          if (!CollectionUtils.isEmpty(newJobs)) {
              hudsonJobRepository.save(newJobs);
          }
          log("New jobs", start, count);
      }
docs: Adds new {@link HudsonJob}s to the database as disabled jobs.
  
  @param jobs         list of {@link HudsonJob}s
  @param existingJobs
  @param collector    the {@link HudsonCollector}