@@ -0,0 +1,2812 @@
+package com.cronutils;%0A%0Aimport com.cronutils.model.Cron;%0Aimport com.cronutils.model.CronType;%0Aimport com.cronutils.model.definition.CronDefinitionBuilder;%0Aimport com.cronutils.model.time.ExecutionTime;%0Aimport com.cronutils.parser.CronParser;%0Aimport org.junit.Test;%0A%0Aimport java.time.DayOfWeek;%0Aimport java.time.ZonedDateTime;%0A%0Aimport static java.time.ZoneOffset.UTC;%0Aimport static java.time.temporal.TemporalAdjusters.firstInMonth;%0Aimport static org.junit.Assert.assertEquals;%0A%0A%0Apublic class Issue388Test %7B%0A%0A    @Test%0A    public void testLastAndNextExecutionWithDowAndDom() %7B%0A%0A        ZonedDateTime dateTime = ZonedDateTime.of(2019, 07, 01, 8, 0, 0, 0, UTC);%0A%0A        CronParser springCronParser = new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.SPRING));%0A        Cron springCron = springCronParser.parse(%220 0 8 1-7 * SAT%22);%0A        ExecutionTime springExecutionTime = ExecutionTime.forCron(springCron);%0A        ZonedDateTime nextSpringExecutionTime = springExecutionTime.nextExecution(dateTime).get();%0A        ZonedDateTime lastSpringExecutionTime = springExecutionTime.lastExecution(dateTime).get();%0A%0A        //quartz%0A        CronParser quartzCronParser = new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ));%0A        Cron quartzCron = quartzCronParser.parse(%220 0 8 ? * SAT#1%22);%0A        ExecutionTime quartzExecutionTime = ExecutionTime.forCron(quartzCron);%0A        ZonedDateTime nextQuartzExecutionTime = quartzExecutionTime.nextExecution(dateTime).get();%0A        ZonedDateTime lastQuartzExecutionTime = quartzExecutionTime.lastExecution(dateTime).get();%0A%0A        ZonedDateTime lastMonthFirstSaturday = dateTime.withMonth(6)%0A                                                       .with(firstInMonth(DayOfWeek.SATURDAY))%0A                                                       .withHour(8)%0A                                                       .withMinute(0)%0A                                                       .withSecond(0)%0A                                                       .withNano(0);%0A        ZonedDateTime nextMonthFirstSaturday = dateTime.withMonth(7)%0A                                                       .with(firstInMonth(DayOfWeek.SATURDAY))%0A                                                       .withHour(8)%0A                                                       .withMinute(0)%0A                                                       .withSecond(0)%0A                                                       .withNano(0);%0A        //quartz%0A        assertEquals(lastMonthFirstSaturday, lastQuartzExecutionTime);%0A        assertEquals(nextMonthFirstSaturday, nextQuartzExecutionTime);%0A        //spring%0A        assertEquals(lastMonthFirstSaturday, lastSpringExecutionTime);%0A        assertEquals(nextMonthFirstSaturday, nextSpringExecutionTime);%0A%0A    %7D%0A%7D%0A

Add test for issue #388 - Wrong execution time with dow and dom with spring cron parser