public FEELFnResult<Object> invoke(@ParameterName("list") List list) {
        if ( list == null || list.isEmpty() ) {
            return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null or empty"));
        } else {
            try {
                return FEELFnResult.ofResult(Collections.max(list, new InterceptNotComparableComparator()));
            } catch (ClassCastException e) {
                return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "contains items that are not comparable"));
            }
        }
    }
@Test
    void invokeArrayOfChronoPeriods() {
        final ChronoPeriod p1Period = Period.parse("P1Y");
        final ChronoPeriod p1Comparable = ComparablePeriod.parse("P1Y");
        final ChronoPeriod p2Period = Period.parse("P1M");
        final ChronoPeriod p2Comparable = ComparablePeriod.parse("P1M");
        Predicate<ChronoPeriod> assertion = i -> i.get(ChronoUnit.YEARS) == 1 && i.get(ChronoUnit.MONTHS) == 0;
        FunctionTestUtil.assertPredicateOnResult(maxFunction.invoke(new Object[]{p1Period}), ChronoPeriod.class,
                                                 assertion);
        FunctionTestUtil.assertPredicateOnResult(maxFunction.invoke(new Object[]{p1Comparable}), ChronoPeriod.class,
                                                 assertion);
        FunctionTestUtil.assertPredicateOnResult(maxFunction.invoke(new Object[]{p1Period, p2Period}),
                                                 ChronoPeriod.class, assertion);
        FunctionTestUtil.assertPredicateOnResult(maxFunction.invoke(new Object[]{p1Comparable, p2Period}),
                                                 ChronoPeriod.class, assertion);
        FunctionTestUtil.assertPredicateOnResult(maxFunction.invoke(new Object[]{p1Period, p2Comparable}),
                                                 ChronoPeriod.class, assertion);
        FunctionTestUtil.assertPredicateOnResult(maxFunction.invoke(new Object[]{p1Comparable, p2Comparable}),
                                                 ChronoPeriod.class, assertion);
    }