class FlattenFunction extends BaseFEELFunction {

    public FEELFnResult<List> invoke(@ParameterName( "list" ) Object list) {
        if ( list == null ) {
            return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null"));
        }
        // spec requires us to return a new list
        final List<Object> result = new ArrayList<>();
        flattenList( list, result );
        return FEELFnResult.ofResult( result );
    }

    public  FlattenFunction();

}