class CurrencyParameterSensitivities implements FxConvertible<CurrencyParameterSensitivities>, ImmutableBean, Serializable {

  public CurrencyAmount total(Currency resultCurrency, FxRateProvider rateProvider) {
    CurrencyParameterSensitivities converted = convertedTo(resultCurrency, rateProvider);
    double total = converted.sensitivities.stream()
        .mapToDouble(s -> s.getSensitivity().sum())
        .sum();
    return CurrencyAmount.of(resultCurrency, total);
  }

  @ImmutableConstructor private  CurrencyParameterSensitivities(List<? extends CurrencyParameterSensitivity> sensitivities);
  private  CurrencyParameterSensitivities(ImmutableList<CurrencyParameterSensitivity> sensitivities);

}