code: public double getATMForward(AnalyticModelInterface model, boolean isFirstPeriodIncluded) {
  		if(!Double.isNaN(cachedATMForward) && cacheStateModel.get() == model && cacheStateIsFirstPeriodIncluded == isFirstPeriodIncluded) {
  			return cachedATMForward;
  		}
  
  		ScheduleInterface remainderSchedule = schedule;
  		if(!isFirstPeriodIncluded) {
  			ArrayList<Period> periods = new ArrayList<Period>();
  			periods.addAll(schedule.getPeriods());
  
  			if(periods.size() > 1) {
  				periods.remove(0);
  			}
  			remainderSchedule = new Schedule(schedule.getReferenceDate(), periods, schedule.getDaycountconvention());
  		}
  
  		SwapLeg floatLeg = new SwapLeg(remainderSchedule, forwardCurveName, 0.0, discountCurveName, false);
  		SwapLeg annuityLeg = new SwapLeg(remainderSchedule, null, 1.0, discountCurveName, false);
  
  		cachedATMForward = floatLeg.getValue(model) / annuityLeg.getValue(model);
  		cacheStateModel = new SoftReference<AnalyticModelInterface>(model);
  		cacheStateIsFirstPeriodIncluded = isFirstPeriodIncluded;
  
  		return cachedATMForward;
  	}
docs: Return the ATM forward for this cap.
  The ATM forward is the fixed rate K such that the value of the payoffs
  \( F(t_i) - K \)
  is zero, where \( F(t_i) \) is the ATM forward of the i-th caplet.
  Note however that the is a convention to determine the ATM forward of a cap
  from the payoffs excluding the first one. The reason here is that for non-forward starting
  cap, the first period is already fixed, i.e. it has no vega.
  
  @param model The model to retrieve the forward curve from (by name).
  @param isFirstPeriodIncluded If true, the forward will be determined by considering the periods after removal of the first periods (except, if the Cap consists only of 1 period).
  @return The ATM forward of this cap.