code: public Collection<Iteration> getIterations(IterationFilter filter, boolean includeSubprojects) {
          filter = (filter != null) ? filter : new IterationFilter();
  
          filter.schedule.clear();
  
          if (includeSubprojects) {
  
              for (Project p : getThisAndAllChildProjects()) {
                  filter.schedule.add(p.getSchedule());
              }
          } else {
              filter.schedule.add(getSchedule());
          }
  
          return getInstance().get().iterations(filter);
      }
docs: Get Iterations in this Project's schedule filtered as specified in the passed in
  filter. This returns iterations even if the schedule is defined in a
  parent project.
  
  @param filter             Criteria to filter on. Schedule will be set automatically.
  If null, all iterations in the project are returned.
  @param includeSubprojects Specifies whether to include items from sub
  project or not. This only adds open subprojects.
  @return A read only Collection of Iteration.