public FEELFnResult<List> invoke(@ParameterName("list") List list, @ParameterName("position") BigDecimal position,
                                     @ParameterName("newItem") Object newItem) {
        if (list == null) {
            return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", CANNOT_BE_NULL));
        }
        if (position == null) {
            return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "position", CANNOT_BE_NULL));
        }
        int intPosition = position.intValue();
        if (intPosition == 0 || Math.abs(intPosition) > list.size()) {
            String paramProblem = String.format("%s outside valid boundaries (1-%s)", intPosition, list.size());
            return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "position", paramProblem));
        }
        Object e = NumberEvalHelper.coerceNumber(newItem);
        List toReturn = new ArrayList(list);
        int replacementPosition = intPosition > 0 ? intPosition -1 : list.size() - Math.abs(intPosition);
        toReturn.set(replacementPosition, e);
        return FEELFnResult.ofResult(toReturn);
    }
@Test
    void invokeReplaceByPositionWithNull() {
        List list = getList();
        List expected = new ArrayList<>(list);
        expected.set(1, null);
        FunctionTestUtil.assertResult(listReplaceFunction.invoke(list, BigDecimal.valueOf(2), null), expected);
    }