### Question:
RatesCurveInputsMarketDataFunction implements MarketDataFunction<RatesCurveInputs, RatesCurveInputsId> { @Override public MarketDataRequirements requirements(RatesCurveInputsId id, MarketDataConfig marketDataConfig) { RatesCurveGroupDefinition groupConfig = marketDataConfig.get(RatesCurveGroupDefinition.class, id.getCurveGroupName()); Optional<CurveDefinition> optionalDefinition = groupConfig.findCurveDefinition(id.getCurveName()); if (!optionalDefinition.isPresent()) { return MarketDataRequirements.empty(); } CurveDefinition definition = optionalDefinition.get(); return MarketDataRequirements.builder().addValues(nodeRequirements(ImmutableList.of(definition))).build(); }  @Override MarketDataRequirements requirements(RatesCurveInputsId id, MarketDataConfig marketDataConfig); @Override MarketDataBox<RatesCurveInputs> build(
      RatesCurveInputsId id,
      MarketDataConfig marketDataConfig,
      ScenarioMarketData marketData,
      ReferenceData refData); @Override Class<RatesCurveInputsId> getMarketDataIdType();  }### Answer:
@Test public void requirements() { FraCurveNode node1x4 = fraNode(1, "a"); FraCurveNode node2x5 = fraNode(2, "b"); FraCurveNode node3x6 = fraNode(3, "c"); InterpolatedNodalCurveDefinition curve = InterpolatedNodalCurveDefinition.builder() .name(CurveName.of("curve")) .interpolator(CurveInterpolators.DOUBLE_QUADRATIC) .extrapolatorLeft(CurveExtrapolators.FLAT) .extrapolatorRight(CurveExtrapolators.FLAT) .nodes(node1x4, node2x5, node3x6) .build(); RatesCurveGroupDefinition groupDefn = RatesCurveGroupDefinition.builder() .name(CurveGroupName.of("curve group")) .addDiscountCurve(curve, Currency.USD) .build(); MarketDataConfig marketDataConfig = MarketDataConfig.builder() .add(groupDefn.getName(), groupDefn) .build(); RatesCurveInputsMarketDataFunction marketDataFunction = new RatesCurveInputsMarketDataFunction(); RatesCurveInputsId curveInputsId = RatesCurveInputsId.of(groupDefn.getName(), curve.getName(), ObservableSource.NONE); MarketDataRequirements requirements = marketDataFunction.requirements(curveInputsId, marketDataConfig); assertThat(requirements.getObservables()) .contains(QuoteId.of(StandardId.of("test", "a"))) .contains(QuoteId.of(StandardId.of("test", "b"))) .contains(QuoteId.of(StandardId.of("test", "c"))); }
@Test public void requirementsMissingGroupConfig() { RatesCurveInputsMarketDataFunction marketDataFunction = new RatesCurveInputsMarketDataFunction(); RatesCurveInputsId curveInputsId = RatesCurveInputsId.of(CurveGroupName.of("curve group"), CurveName.of("curve"), ObservableSource.NONE); assertThatIllegalArgumentException() .isThrownBy(() -> marketDataFunction.requirements(curveInputsId, MarketDataConfig.empty())); }