### Question:
OvernightFutureTradeCalculationFunction implements CalculationFunction<T> { @Override public Map<Measure, Result<?>> calculate( T target, Set<Measure> measures, CalculationParameters parameters, ScenarioMarketData scenarioMarketData, ReferenceData refData) { ResolvedOvernightFutureTrade resolved = target.resolve(refData); RatesMarketDataLookup ratesLookup = parameters.getParameter(RatesMarketDataLookup.class); RatesScenarioMarketData marketData = ratesLookup.marketDataView(scenarioMarketData); Map<Measure, Result<?>> results = new HashMap<>(); for (Measure measure : measures) { results.put(measure, calculate(measure, resolved, marketData)); } return results; } OvernightFutureTradeCalculationFunction(Class<T> targetType); @Override Class<T> targetType(); @Override Set<Measure> supportedMeasures(); @Override Optional<String> identifier(T target); @Override Currency naturalCurrency(T target, ReferenceData refData); @Override FunctionRequirements requirements(
      T target,
      Set<Measure> measures,
      CalculationParameters parameters,
      ReferenceData refData); @Override Map<Measure, Result<?>> calculate(
      T target,
      Set<Measure> measures,
      CalculationParameters parameters,
      ScenarioMarketData scenarioMarketData,
      ReferenceData refData); static final OvernightFutureTradeCalculationFunction<OvernightFutureTrade> TRADE; static final OvernightFutureTradeCalculationFunction<OvernightFuturePosition> POSITION; }### Answer:
@Test public void test_simpleMeasures() { OvernightFutureTradeCalculationFunction<OvernightFutureTrade> function = OvernightFutureTradeCalculationFunction.TRADE; ScenarioMarketData md = marketData(FORWARD_CURVE_ID.getCurveName()); RatesProvider provider = RATES_LOOKUP.ratesProvider(md.scenario(0)); double expectedPrice = TRADE_PRICER.price(RESOLVED_TRADE, provider); CurrencyAmount expectedPv = TRADE_PRICER.presentValue(RESOLVED_TRADE, provider, MARKET_PRICE / 100d); double expectedParSpread = TRADE_PRICER.parSpread(RESOLVED_TRADE, provider, MARKET_PRICE / 100d); Set<Measure> measures = ImmutableSet.of( Measures.UNIT_PRICE, Measures.PRESENT_VALUE, Measures.PAR_SPREAD, Measures.RESOLVED_TARGET); assertThat(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)) .containsEntry( Measures.UNIT_PRICE, Result.success(DoubleScenarioArray.of(ImmutableList.of(expectedPrice)))) .containsEntry( Measures.PRESENT_VALUE, Result.success(CurrencyScenarioArray.of(ImmutableList.of(expectedPv)))) .containsEntry( Measures.PAR_SPREAD, Result.success(DoubleScenarioArray.of(ImmutableList.of(expectedParSpread)))) .containsEntry( Measures.RESOLVED_TARGET, Result.success(RESOLVED_TRADE)); }