class FxIndexSensitivity implements PointSensitivity, PointSensitivityBuilder, ImmutableBean, Serializable {

  public static FxIndexSensitivity of(FxIndexObservation observation, Currency referenceCurrency, double sensitivity) {
    CurrencyPair obsPair = observation.getCurrencyPair();
    boolean inverse = referenceCurrency.equals(obsPair.getCounter());
    CurrencyPair queriedPair = inverse ? obsPair.inverse() : obsPair;
    Currency sensiCurrency = queriedPair.getCounter();
    return new FxIndexSensitivity(observation, referenceCurrency, sensiCurrency, sensitivity);
  }

  private  FxIndexSensitivity(
      FxIndexObservation observation,
      Currency referenceCurrency,
      Currency currency,
      double sensitivity);

}