class YearsAndMonthsFunction extends BaseFEELFunction {

    public FEELFnResult<TemporalAmount> invoke(@ParameterName("from") Temporal from, @ParameterName("to") Temporal to) {
        if ( from == null ) {
            return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "from", "cannot be null"));
        }
        if ( to == null ) {
            return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "to", "cannot be null"));
        }
        final LocalDate fromDate = getLocalDateFromTemporal(from);
        if (fromDate == null) {
            return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "from", "is of type not suitable for years and months function"));
        }
        final LocalDate toDate = getLocalDateFromTemporal(to);
        if (toDate == null) {
            return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "to", "is of type not suitable for years and months function"));
        }

        return FEELFnResult.ofResult(new ComparablePeriod(Period.between(fromDate, toDate).withDays(0)));
    }

    public  YearsAndMonthsFunction();

}