if (occupationPeriod.getStart().equals(startDate) && occupationPeriod.getEnd().equals(endDate)
if (DateFormatUtil.equalDates("yyyy-MM-dd", occupationPeriod.getStart(), startDate) && DateFormatUtil.equalDates("yyyy-MM-dd", occupationPeriod.getEnd(), endDate)
    public static OccupationPeriod readByDatesAndNextOccupationPeriod(Date startDate, Date endDate, OccupationPeriod nextOccupationPeriod) {        for (OccupationPeriod occupationPeriod : RootDomainObject.getInstance().getOccupationPeriods()) {            if (occupationPeriod.getStart().equals(startDate)                    && occupationPeriod.getEnd().equals(endDate)                     && (nextOccupationPeriod == null || (nextOccupationPeriod != null && occupationPeriod.getNextPeriod().equals(nextOccupationPeriod)))) {                        return occupationPeriod;            }        }        return null;    }