public virtual void getParameter2()
        {
            CalculationParameters test = CalculationParameters.of(ImmutableList.of(PARAM2));

            assertEquals(test.getParameter(typeof(TestParameter2)), PARAM2);
            assertEquals(test.getParameter(typeof(TestInterfaceParameter)), PARAM2);
            assertThrowsIllegalArg(() => test.getParameter(typeof(TestParameter)));
            assertEquals(test.findParameter(typeof(TestParameter2)), PARAM2);
            assertEquals(test.findParameter(typeof(TestInterfaceParameter)), PARAM2);
            assertEquals(test.findParameter(typeof(TestParameter)), null);
        }
        public virtual void of_list()
        {
            CalculationParameters test = CalculationParameters.of(ImmutableList.of(PARAM));

            assertEquals(test.Parameters.size(), 1);
            assertEquals(test.findParameter(typeof(TestParameter)), PARAM);
        }
        //-------------------------------------------------------------------------
        /// <summary>
        /// Executes the task, performing calculations for the target using multiple sets of market data.
        /// <para>
        /// This invokes the function with the correct set of market data.
        ///
        /// </para>
        /// </summary>
        /// <param name="marketData">  the market data used in the calculation </param>
        /// <param name="refData">  the reference data </param>
        /// <returns> results of the calculation, one for every scenario in the market data </returns>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") public CalculationResults execute(com.opengamma.strata.data.scenario.ScenarioMarketData marketData, com.opengamma.strata.basics.ReferenceData refData)
        public CalculationResults execute(ScenarioMarketData marketData, ReferenceData refData)
        {
            // calculate the results
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Map<com.opengamma.strata.calc.Measure, com.opengamma.strata.collect.result.Result<?>> results = calculate(marketData, refData);
            IDictionary <Measure, Result <object> > results = calculate(marketData, refData);

            // get a suitable FX provider
            ScenarioFxRateProvider fxProvider = parameters.findParameter(typeof(FxRateLookup)).map(lookup => LookupScenarioFxRateProvider.of(marketData, lookup)).orElse(ScenarioFxRateProvider.of(marketData));

            // convert the results, using a normal loop for better stack traces
            ImmutableList.Builder <CalculationResult> resultBuilder = ImmutableList.builder();
            foreach (CalculationTaskCell cell in cells)
            {
                resultBuilder.add(cell.createResult(this, target, results, fxProvider, refData));
            }

            // return the result
            return(CalculationResults.of(target, resultBuilder.build()));
        }