class IndexOfFunction extends BaseFEELFunction {

    public FEELFnResult<List<BigDecimal>> invoke(@ParameterName( "list" ) List list, @ParameterName( "match" ) Object match) {
        if ( list == null ) {
            return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null"));
        }

        final List<BigDecimal> result = new ArrayList<>();
        for( int i = 0; i < list.size(); i++ ) {
            Object o = list.get( i );
            if ( o == null && match == null) {
                result.add( BigDecimal.valueOf( i+1 ) );
            } else if ( o != null && match != null ) {
                if ( equalsAsBigDecimals(o, match) || o.equals(match) ) {
                    result.add( BigDecimal.valueOf( i+1 ) );
                }
            }
        }
        return FEELFnResult.ofResult( result );
    }

    public  IndexOfFunction();

}