### Question:
ApproxForwardOvernightAveragedRateComputationFn implements RateComputationFn<OvernightAveragedRateComputation> { @Override public PointSensitivityBuilder rateSensitivity( OvernightAveragedRateComputation computation, LocalDate startDate, LocalDate endDate, RatesProvider provider) { OvernightIndexRates rates = provider.overnightIndexRates(computation.getIndex()); LocalDate valuationDate = rates.getValuationDate(); LocalDate startFixingDate = computation.getStartDate(); LocalDate startPublicationDate = computation.calculatePublicationFromFixing(startFixingDate); if (valuationDate.isBefore(startPublicationDate)) { return rateForwardSensitivity(computation, rates); } ObservationDetails details = new ObservationDetails(computation, rates); return details.calculateRateSensitivity(); } ApproxForwardOvernightAveragedRateComputationFn(); @Override double rate(
      OvernightAveragedRateComputation computation,
      LocalDate startDate,
      LocalDate endDate,
      RatesProvider provider); @Override PointSensitivityBuilder rateSensitivity(
      OvernightAveragedRateComputation computation,
      LocalDate startDate,
      LocalDate endDate,
      RatesProvider provider); @Override double explainRate(
      OvernightAveragedRateComputation computation,
      LocalDate startDate,
      LocalDate endDate,
      RatesProvider provider,
      ExplainMapBuilder builder); static final ApproxForwardOvernightAveragedRateComputationFn DEFAULT; }### Answer:
@Test public void rateFedFund2CutOffValuationEndSensitivity() { LocalDate[] valuationDate = {date(2015, 1, 15), date(2015, 1, 16)}; OvernightAveragedRateComputation ro = OvernightAveragedRateComputation.of(USD_FED_FUND, FIXING_START_DATE, FIXING_END_DATE, 2, REF_DATA); OvernightIndexRates mockRates = mock(OvernightIndexRates.class); when(mockRates.getIndex()).thenReturn(USD_FED_FUND); SimpleRatesProvider simpleProv = new SimpleRatesProvider(mockRates); LocalDateDoubleTimeSeriesBuilder tsb = LocalDateDoubleTimeSeries.builder(); int lastFixing = 6; for (int i = 0; i < lastFixing; i++) { tsb.put(FIXING_DATES[i], FIXING_RATES[i]); } when(mockRates.getFixings()).thenReturn(tsb.build()); for (int loopvaldate = 0; loopvaldate < 2; loopvaldate++) { when(mockRates.getValuationDate()).thenReturn(valuationDate[loopvaldate]); PointSensitivityBuilder sensitivityBuilderExpected = OBS_FN_APPROX_FWD.rateSensitivity(ro, DUMMY_ACCRUAL_START_DATE, DUMMY_ACCRUAL_END_DATE, simpleProv); assertThat(sensitivityBuilderExpected).isEqualTo(PointSensitivityBuilder.none()); } }