class ForwardIborInterpolatedRateComputationFn implements RateComputationFn<IborInterpolatedRateComputation> {

  @Override
  public PointSensitivityBuilder rateSensitivity(
      IborInterpolatedRateComputation computation,
      LocalDate startDate,
      LocalDate endDate,
      RatesProvider provider) {

    // computes the dates related to the underlying deposits associated to the indices
    IborIndexObservation obs1 = computation.getShortObservation();
    IborIndexObservation obs2 = computation.getLongObservation();
    DoublesPair weights = weights(obs1, obs2, endDate);
    double totalWeight = weights.getFirst() + weights.getSecond();

    IborIndexRates ratesIndex1 = provider.iborIndexRates(obs1.getIndex());
    PointSensitivityBuilder sens1 = ratesIndex1.ratePointSensitivity(obs1)
        .multipliedBy(weights.getFirst() / totalWeight);
    IborIndexRates ratesIndex2 = provider.iborIndexRates(obs2.getIndex());
    PointSensitivityBuilder sens2 = ratesIndex2.ratePointSensitivity(obs2)
        .multipliedBy(weights.getSecond() / totalWeight);
    return sens1.combinedWith(sens2);
  }

  public  ForwardIborInterpolatedRateComputationFn();

}