if ((this.getBeginDate().after(beginDate) || this.getBeginDate().equals(beginDate)) && (this.getEndDate() == null || (this.getEndDate().equals(endDate) || this.getEndDate().before( endDate)))) {
if ((this.getBeginDate().before(beginDate) || this.getBeginDate().after(beginDate)) && (this.getEndDate() == null || (this.getEndDate().before(endDate) || this .getEndDate().after(endDate)))) {
    public boolean belongsToPeriod(Date beginDate, Date endDate) {        if ((this.getBeginDate().after(beginDate) || this.getBeginDate().equals(beginDate))                && (this.getEndDate() == null || (this.getEndDate().equals(endDate) || this.getEndDate().before(                        endDate)))) {            return true;        }        return false;    }