code: public synchronized boolean addDependingJob(Job dependingJob) {
      if (this.state == Job.WAITING) { //only allowed to add jobs when waiting
        if (this.dependingJobs == null) {
          this.dependingJobs = new ArrayList<Job>();
        }
        return this.dependingJobs.add(dependingJob);
      } else {
        return false;
      }
    }
docs: Add a job to this jobs' dependency list. Dependent jobs can only be added while a Job
  is waiting to run, not during or afterwards.
  
  @param dependingJob Job that this Job depends on.
  @return <tt>true</tt> if the Job was added.