code: private void addNewBuilds(List<HudsonJob> enabledJobs,
                                Map<HudsonJob, Map<HudsonClient.jobData, Set<BaseModel>>> dataByJob) {
          long start = System.currentTimeMillis();
          int count = 0;
  
          for (HudsonJob job : enabledJobs) {
              if (job.isPushed()) continue;
              // process new builds in the order of their build numbers - this has implication to handling of commits in BuildEventListener
  
              Map<HudsonClient.jobData, Set<BaseModel>> jobDataSetMap = dataByJob.get(job);
              if (jobDataSetMap == null) {
                  continue;
              }
              Set<BaseModel> buildsSet = jobDataSetMap.get(HudsonClient.jobData.BUILD);
  
              ArrayList<BaseModel> builds = Lists.newArrayList(nullSafe(buildsSet));
  
              builds.sort(Comparator.comparingInt(b -> Integer.valueOf(((Build) b).getNumber())));
              for (BaseModel buildSummary : builds) {
                  if (isNewBuild(job, (Build)buildSummary)) {
                      Build build = hudsonClient.getBuildDetails(((Build)buildSummary)
                              .getBuildUrl(), job.getInstanceUrl());
                      job.setLastUpdated(System.currentTimeMillis());
                      hudsonJobRepository.save(job);
                      if (build != null) {
                          build.setCollectorItemId(job.getId());
                          buildRepository.save(build);
                          count++;
                      }
                  }
              }
          }
          log("New builds", start, count);
      }
docs: Iterates over the enabled build jobs and adds new builds to the database.
  
  @param enabledJobs list of enabled {@link HudsonJob}s
  @param dataByJob maps a {@link HudsonJob} to a map of data with {@link Build}s.