### Question:
CalculationTask implements ImmutableBean { @SuppressWarnings("unchecked") public MarketDataRequirements requirements(ReferenceData refData) { FunctionRequirements functionRequirements = function.requirements(target, getMeasures(), parameters, refData); ObservableSource obsSource = functionRequirements.getObservableSource(); MarketDataRequirementsBuilder requirementsBuilder = MarketDataRequirements.builder(); for (ObservableId id : functionRequirements.getTimeSeriesRequirements()) { requirementsBuilder.addTimeSeries(id.withObservableSource(obsSource)); } for (MarketDataId<?> id : functionRequirements.getValueRequirements()) { if (id instanceof ObservableId) { requirementsBuilder.addValues(((ObservableId) id).withObservableSource(obsSource)); } else { requirementsBuilder.addValues(id); } } for (CalculationTaskCell cell : cells) { if (cell.getMeasure().isCurrencyConvertible() && !cell.getReportingCurrency().isNone()) { Currency reportingCurrency = cell.reportingCurrency(this, refData); List<MarketDataId<FxRate>> fxRateIds = functionRequirements.getOutputCurrencies().stream() .filter(outputCurrency -> !outputCurrency.equals(reportingCurrency)) .map(outputCurrency -> CurrencyPair.of(outputCurrency, reportingCurrency)) .map(pair -> FxRateId.of(pair, obsSource)) .collect(toImmutableList()); requirementsBuilder.addValues(fxRateIds); } } return requirementsBuilder.build(); } private  CalculationTask(
      CalculationTarget target,
      CalculationFunction<CalculationTarget> function,
      CalculationParameters parameters,
      List<CalculationTaskCell> cells); static CalculationTask of(
      CalculationTarget target,
      CalculationFunction<? extends CalculationTarget> function,
      CalculationTaskCell... cells); static CalculationTask of(
      CalculationTarget target,
      CalculationFunction<? extends CalculationTarget> function,
      CalculationParameters parameters,
      List<CalculationTaskCell> cells); int getRowIndex(); Set<Measure> getMeasures(); @SuppressWarnings("unchecked") MarketDataRequirements requirements(ReferenceData refData); Currency naturalCurrency(ReferenceData refData); @SuppressWarnings("unchecked") CalculationResults execute(ScenarioMarketData marketData, ReferenceData refData); @Override String toString(); static TypedMetaBean<CalculationTask> meta(); @Override TypedMetaBean<CalculationTask> metaBean(); CalculationTarget getTarget(); CalculationFunction<CalculationTarget> getFunction(); CalculationParameters getParameters(); List<CalculationTaskCell> getCells(); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void requirements() { CalculationTaskCell cell = CalculationTaskCell.of(0, 0, TestingMeasures.PRESENT_VALUE, NATURAL); CalculationTask task = CalculationTask.of(TARGET, new TestFunction(), cell); MarketDataRequirements requirements = task.requirements(REF_DATA); Set<? extends MarketDataId<?>> nonObservables = requirements.getNonObservables(); ImmutableSet<? extends ObservableId> observables = requirements.getObservables(); ImmutableSet<ObservableId> timeSeries = requirements.getTimeSeries(); MarketDataId<?> timeSeriesId = TestObservableId.of("3", OBS_SOURCE); assertThat(timeSeries).hasSize(1); assertThat(timeSeries.iterator().next()).isEqualTo(timeSeriesId); MarketDataId<?> nonObservableId = new TestId("1"); assertThat(nonObservables).hasSize(1); assertThat(nonObservables.iterator().next()).isEqualTo(nonObservableId); MarketDataId<?> observableId = TestObservableId.of("2", OBS_SOURCE); assertThat(observables).hasSize(1); assertThat(observables.iterator().next()).isEqualTo(observableId); }