final YearMonthDay yearMonthDay = new YearMonthDay();
    private static void createExecutionYears() {        final ExecutionYear executionYear = new ExecutionYear();        executionYear.setYear(constructExecutionYearString());        executionYear.setState(PeriodState.CURRENT);        final ExecutionPeriod executionPeriod1 = new ExecutionPeriod();        executionPeriod1.setSemester(Integer.valueOf(1));        executionPeriod1.setExecutionYear(executionYear);        final ExecutionPeriod executionPeriod2 = new ExecutionPeriod();        executionPeriod2.setSemester(Integer.valueOf(2));        executionPeriod2.setExecutionYear(executionYear);        executionPeriod1.setNextExecutionPeriod(executionPeriod2);        final YearMonthDay yearMonthDay = new YearMonthDay();        if (yearMonthDay.getMonthOfYear() < 8) {            final YearMonthDay previousYear = yearMonthDay.minusYears(1);            executionPeriod1.setBeginDateYearMonthDay(new YearMonthDay(previousYear.getYear(), 9, 1));            executionPeriod1.setEndDateYearMonthDay(new YearMonthDay(yearMonthDay.getYear(), 1, 31));            executionPeriod2.setBeginDateYearMonthDay(new YearMonthDay(yearMonthDay.getYear(), 2, 1));            executionPeriod2.setEndDateYearMonthDay(new YearMonthDay(yearMonthDay.getYear(), 7, 31));            if (yearMonthDay.getMonthOfYear() < 2) {                executionPeriod1.setState(PeriodState.CURRENT);                executionPeriod2.setState(PeriodState.OPEN);            } else {                executionPeriod1.setState(PeriodState.OPEN);                executionPeriod2.setState(PeriodState.CURRENT);                            }        } else {            executionPeriod1.setBeginDateYearMonthDay(new YearMonthDay(yearMonthDay.getYear(), 9, 1));            executionPeriod1.setEndDateYearMonthDay(new YearMonthDay(yearMonthDay.getYear() + 1, 1, 31));            executionPeriod2.setBeginDateYearMonthDay(new YearMonthDay(yearMonthDay.getYear() + 1, 2, 1));            executionPeriod2.setEndDateYearMonthDay(new YearMonthDay(yearMonthDay.getYear() + 1, 7, 31));            executionPeriod1.setState(PeriodState.CURRENT);            executionPeriod2.setState(PeriodState.OPEN);        }    }