public FEELFnResult<String> invoke(@ParameterName("list") List<?> list, @ParameterName("delimiter") String delimiter) {
        if ( list == null ) {
            return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null"));
        }
        if (list.isEmpty()) {
            return FEELFnResult.ofResult(""); // If list is empty, the result is the empty string
        }
        StringJoiner sj = new StringJoiner(delimiter != null ? delimiter : ""); // If delimiter is null, the string elements are joined without a separator
        for (Object element : list) {
            if (element == null) {
                continue; // Null elements in the list parameter are ignored.
            } else if (element instanceof CharSequence) {
                sj.add((CharSequence) element);
            } else {
                return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "contains an element which is not a string"));
            }
        }
        return FEELFnResult.ofResult(sj.toString());
    }
@Test
    void stringJoinFunctionEmptyList() {
        FunctionTestUtil.assertResult(stringJoinFunction.invoke(Collections.emptyList()), "");
        FunctionTestUtil.assertResult(stringJoinFunction.invoke(Collections.emptyList(), "X"), "");
    }