public static ForIteration getForIteration(EvaluationContext ctx, String name, Object start, Object end) {
        validateValues(ctx, start, end);
        if (start instanceof BigDecimal bigDecimal) {
            return new ForIteration(name, bigDecimal, (BigDecimal) end);
        }
        if (start instanceof LocalDate localDate) {
            return new ForIteration(name, localDate, (LocalDate) end);
        }
        ctx.notifyEvt(() -> new ASTEventBase(FEELEvent.Severity.ERROR,
                                             Msg.createMessage(Msg.VALUE_X_NOT_A_VALID_ENDPOINT_FOR_RANGE_BECAUSE_NOT_A_NUMBER_NOT_A_DATE, start), null));
        throw new EndpointOfRangeOfDifferentTypeException();
    }
@Test
    void getForIterationNotValidTest() {
        try {
            getForIteration(ctx, "iteration", "NOT", "VALID");
        } catch (Exception e) {
            assertTrue(e instanceof EndpointOfRangeNotValidTypeException);
            final ArgumentCaptor<FEELEvent> captor = ArgumentCaptor.forClass(FEELEvent.class);
            verify(listener, times(1)).onEvent(captor.capture());
            reset(listener);
        }
        try {
            getForIteration(ctx, "iteration", BigDecimal.valueOf(1), LocalDate.of(2021, 1, 1));
        } catch (Exception e) {
            assertTrue(e instanceof EndpointOfRangeOfDifferentTypeException);
            final ArgumentCaptor<FEELEvent> captor = ArgumentCaptor.forClass(FEELEvent.class);
            verify(listener, times(1)).onEvent(captor.capture());
            reset(listener);
        }
        try {
            getForIteration(ctx, "iteration", LocalDate.of(2021, 1, 1), BigDecimal.valueOf(1));
        } catch (Exception e) {
            assertTrue(e instanceof EndpointOfRangeOfDifferentTypeException);
            final ArgumentCaptor<FEELEvent> captor = ArgumentCaptor.forClass(FEELEvent.class);
            verify(listener, times(1)).onEvent(captor.capture());
            reset(listener);
        }
    }