// calculate one measure private Result<?> calculate( Measure measure, ResolvedBulletPaymentTrade trade, RatesScenarioMarketData marketData) { SingleMeasureCalculation calculator = CALCULATORS.get(measure); if (calculator == null) { return Result.failure( FailureReason.UNSUPPORTED, "Unsupported measure for BulletPaymentTrade: {}", measure); } return Result.of(() -> calculator.calculate(trade, marketData)); }