@Override
 protected Set<ComputedValue> getResult(
     final Forex fxForward,
     final YieldCurveBundle data,
     final ComputationTarget target,
     final Set<ValueRequirement> desiredValues,
     final FunctionInputs inputs,
     final ValueSpecification spec,
     final FunctionExecutionContext executionContext) {
   final MultipleCurrencyAmount result = CALCULATOR.visit(fxForward, data);
   return Collections.singleton(new ComputedValue(spec, result));
 }
public class FXForwardCurrencyExposureFunction extends FXForwardMultiValuedFunction {
  private static final CurrencyExposureForexCalculator CALCULATOR =
      CurrencyExposureForexCalculator.getInstance();

  public FXForwardCurrencyExposureFunction() {
    super(ValueRequirementNames.FX_CURRENCY_EXPOSURE);
  }

  @Override
  protected Set<ComputedValue> getResult(
      final Forex fxForward,
      final YieldCurveBundle data,
      final ComputationTarget target,
      final Set<ValueRequirement> desiredValues,
      final FunctionInputs inputs,
      final ValueSpecification spec,
      final FunctionExecutionContext executionContext) {
    final MultipleCurrencyAmount result = CALCULATOR.visit(fxForward, data);
    return Collections.singleton(new ComputedValue(spec, result));
  }
}