AbstractCreditRiskMeasureFn implements CreditRiskMeasureFn<T> { @Override public Result<T> priceStandardCds(Environment env, StandardCDSTrade trade) { StandardCDSSecurity cds = (StandardCDSSecurity) trade.getTrade().getSecurity(); Result<IsdaCreditCurve> marketDataResult = resolveMarketData(env, _standardCdsMarketDataResolverFn, cds); if (!marketDataResult.isSuccess()) { return Result.failure(marketDataResult); } IsdaCreditCurve creditCurve = marketDataResult.getValue(); Result<CDSAnalytic> analyticResult = _standardCdsConverterFn.toCdsAnalytic(env, cds, creditCurve); if (analyticResult.isSuccess()) { return price(extractForStandardCds(cds, creditCurve), analyticResult.getValue(), creditCurve); } else { return Result.failure(analyticResult); } } protected  AbstractCreditRiskMeasureFn(LegacyCdsConverterFn legacyCdsConverterFn, 
                                     StandardCdsConverterFn standardCdsConverterFn,
                                     IndexCdsConverterFn indexCdsConverterFn,
                                     IndexCdsMarketDataResolverFn indexCdsMarketDataResolverFn,
                                     StandardCdsMarketDataResolverFn standardCdsMarketDataResolverFn,
                                     LegacyCdsMarketDataResolverFn legacyCdsMarketDataResolverFn, 
                                     IsdaCompliantCreditCurveFn creditCurveFn); @Override Result<T> priceStandardCds(Environment env, StandardCDSTrade trade); @Override Result<T> priceLegacyCds(Environment env, LegacyCDSTrade trade); @Override Result<T> priceIndexCds(Environment env, IndexCDSTrade trade); @Override Result<T> priceStandardCds(Environment env, StandardCDSSecurity cds); @Override Result<T> priceLegacyCds(Environment env, LegacyCDSSecurity cds); @Override Result<T> priceIndexCds(Environment env, IndexCDSSecurity cds);  }
@Test public void priceStandardCds() { Result<RiskResult> result = _creditRiskMeasureFn.priceStandardCds(_env, _cds); assertTrue(result.isSuccess()); }