/**
  * Cap/floor CMS builder from all the cap/floor details.
  *
  * @param paymentDate Coupon payment date.
  * @param accrualStartDate Start date of the accrual period.
  * @param accrualEndDate End date of the accrual period.
  * @param accrualFactor Accrual factor of the accrual period.
  * @param notional Coupon notional.
  * @param fixingDate The coupon fixing date.
  * @param underlyingSwap The underlying swap.
  * @param cmsIndex The CMS index associated to the cap/floor.
  * @param strike The strike
  * @param isCap The cap (true) /floor (false) flag.
  * @return The CMS cap/floor.
  */
 public static CapFloorCMSDefinition from(
     final ZonedDateTime paymentDate,
     final ZonedDateTime accrualStartDate,
     final ZonedDateTime accrualEndDate,
     final double accrualFactor,
     final double notional,
     final ZonedDateTime fixingDate,
     final SwapFixedIborDefinition underlyingSwap,
     final CMSIndex cmsIndex,
     final double strike,
     final boolean isCap) {
   Validate.notNull(underlyingSwap, "underlying swap");
   return new CapFloorCMSDefinition(
       underlyingSwap.getCurrency(),
       paymentDate,
       accrualStartDate,
       accrualEndDate,
       accrualFactor,
       notional,
       fixingDate,
       underlyingSwap,
       cmsIndex,
       strike,
       isCap);
 }