class ForwardIborAveragedRateComputationFn implements RateComputationFn<IborAveragedRateComputation> {

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

    IborIndexRates rates = provider.iborIndexRates(computation.getIndex());

    // combine the weighted sensitivity to each fixing
    // omit fixed rates as they have no sensitivity to a curve
    return computation.getFixings().stream()
        .filter(fixing -> !fixing.getFixedRate().isPresent())
        .map(fixing -> weightedSensitivity(fixing, computation.getTotalWeight(), rates))
        .reduce(PointSensitivityBuilder.none(), PointSensitivityBuilder::combinedWith);
  }

  public  ForwardIborAveragedRateComputationFn();

}