### Question:
CurveMarketDataFunction implements MarketDataFunction<Curve, CurveId> { @Override public MarketDataBox<Curve> build( CurveId id, MarketDataConfig config, ScenarioMarketData marketData, ReferenceData refData) { CurveGroupDefinition groupDefn = config.get(CurveGroupDefinition.class, id.getCurveGroupName()); MarketDataId<? extends CurveGroup> groupId = groupDefn.createGroupId(id.getObservableSource()); MarketDataBox<? extends CurveGroup> curveGroupBox = marketData.getValue(groupId); return curveGroupBox.map(curveGroup -> findCurve(id, curveGroup)); }  @Override MarketDataRequirements requirements(CurveId id, MarketDataConfig config); @Override MarketDataBox<Curve> build(
      CurveId id,
      MarketDataConfig config,
      ScenarioMarketData marketData,
      ReferenceData refData); @Override Class<CurveId> getMarketDataIdType();  }### Answer:
@Test public void test_multipleCurves() { Curve curve1 = ConstantCurve.of(CURVE_NAME1, (double) 1); Curve curve2 = ConstantCurve.of(CURVE_NAME2, (double) 2); CurveId curveId1 = CurveId.of(GROUP_NAME, CURVE_NAME1); CurveId curveId2 = CurveId.of(GROUP_NAME, CURVE_NAME2); RatesCurveGroupId groupId = RatesCurveGroupId.of(GROUP_NAME); RatesCurveGroup curveGroup = RatesCurveGroup.of( GROUP_NAME, ImmutableMap.of(Currency.AUD, curve1, Currency.GBP, curve2), ImmutableMap.of()); ScenarioMarketData marketData = ImmutableScenarioMarketData.builder(VAL_DATE).addValue(groupId, curveGroup).build(); MarketDataConfig config = MarketDataConfig.builder() .add(GROUP_NAME, RatesCurveGroupDefinition.builder().name(GROUP_NAME).build()) .build(); CurveMarketDataFunction test = new CurveMarketDataFunction(); MarketDataBox<Curve> result1 = test.build(curveId1, config, marketData, REF_DATA); assertThat(result1).isEqualTo(MarketDataBox.ofSingleValue(curve1)); MarketDataBox<Curve> result2 = test.build(curveId2, config, marketData, REF_DATA); assertThat(result2).isEqualTo(MarketDataBox.ofSingleValue(curve2)); }