static boolean calculateActualParam(NamedParameter np, List<String> names, Object[] actualParams,
                                        boolean isVariableParameters, String variableParamPrefix,
                                        List<Object> variableParams) {
        logger.trace("calculateActualParam {} {} {} {} {} {}", np, names, actualParams, isVariableParameters, variableParamPrefix, variableParams);
        if (names.contains(np.getName())) {
            actualParams[names.indexOf(np.getName())] = np.getValue();
            return true;
        } else if (isVariableParameters) {
            return calculateActualParamVariableParameters(np, variableParamPrefix, variableParams);
        } else {
            // invalid parameter, method is incompatible
            return false;
        }
    }
@Test
    void calculateActualParam() {
        // populate by NamedParameter value
        NamedParameter np = new NamedParameter("n", BigDecimal.valueOf(1.5));
        List<String> names = Collections.singletonList("n");
        Object[] actualParams = new Object[1];
        boolean isVariableParameters = false;
        String variableParamPrefix = null;
        List<Object> variableParams = null;
        assertTrue(BaseFEELFunctionHelper.calculateActualParam(np, names, actualParams, isVariableParameters,
                                                               variableParamPrefix, variableParams));
        assertEquals(np.getValue(), actualParams[0]);

        np = new NamedParameter("undefined", BigDecimal.valueOf(1.5));
        actualParams = new Object[1];
        assertFalse(BaseFEELFunctionHelper.calculateActualParam(np, names, actualParams, isVariableParameters,
                                                                variableParamPrefix, variableParams));

        // populate by variableparameters
        variableParamPrefix = "varPref";
        int varIndex = 12;
        np = new NamedParameter(variableParamPrefix + varIndex, BigDecimal.valueOf(1.5));
        names = Collections.singletonList("n");
        actualParams = new Object[1];
        isVariableParameters = true;
        variableParams = new ArrayList();
        assertTrue(BaseFEELFunctionHelper.calculateActualParam(np, names, actualParams, isVariableParameters,
                                                               variableParamPrefix, variableParams));
        assertEquals(varIndex, variableParams.size());
        for (int i = 0; i < varIndex - 1; i++) {
            assertNull(variableParams.get(i));
        }
        assertEquals(np.getValue(), variableParams.get(varIndex - 1));
    }