public virtual FunctionRequirements requirements(T target, ISet <Measure> measures, CalculationParameters parameters, ReferenceData refData)
        {
            FunctionRequirements delegateRequirements = @delegate.requirements(target, measures, parameters, refData);
            FunctionRequirements functionRequirements = derivedFunction.requirements(target, parameters, refData);

            return(delegateRequirements.combinedWith(functionRequirements));
        }
        //-------------------------------------------------------------------------
        /// <summary>
        /// Returns requirements specifying the market data the function needs to perform its calculations.
        /// </summary>
        /// <param name="refData">  the reference data </param>
        /// <returns> requirements specifying the market data the function needs to perform its calculations </returns>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") public com.opengamma.strata.calc.marketdata.MarketDataRequirements requirements(com.opengamma.strata.basics.ReferenceData refData)
        public MarketDataRequirements requirements(ReferenceData refData)
        {
            // determine market data requirements of the function
            FunctionRequirements functionRequirements = function.requirements(target, Measures, parameters, refData);
            ObservableSource     obsSource            = functionRequirements.ObservableSource;

            // convert function requirements to market data requirements
            MarketDataRequirementsBuilder requirementsBuilder = MarketDataRequirements.builder();

            foreach (ObservableId id in functionRequirements.TimeSeriesRequirements)
            {
                requirementsBuilder.addTimeSeries(id.withObservableSource(obsSource));
            }
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: for (com.opengamma.strata.data.MarketDataId<?> id : functionRequirements.getValueRequirements())
            foreach (MarketDataId <object> id in functionRequirements.ValueRequirements)
            {
                if (id is ObservableId)
                {
                    requirementsBuilder.addValues(((ObservableId)id).withObservableSource(obsSource));
                }
                else
                {
                    requirementsBuilder.addValues(id);
                }
            }

            // add requirements for the FX rates needed to convert the output values into the reporting currency
            foreach (CalculationTaskCell cell in cells)
            {
                if (cell.Measure.CurrencyConvertible && !cell.ReportingCurrency.None)
                {
                    Currency reportingCurrency = cell.reportingCurrency(this, refData);
//JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter:
                    IList <MarketDataId <FxRate> > fxRateIds = functionRequirements.OutputCurrencies.Where(outputCurrency => !outputCurrency.Equals(reportingCurrency)).Select(outputCurrency => CurrencyPair.of(outputCurrency, reportingCurrency)).Select(pair => FxRateId.of(pair, obsSource)).collect(toImmutableList());
                    requirementsBuilder.addValues(fxRateIds);
                }
            }
            return(requirementsBuilder.build());
        }