if (endDate.getTime() != null) {
if (endDate != null) {
    public void setEndDate(Calendar endDate) {        if (endDate.getTime() != null) {            this.setEnd(endDate.getTime());                    } else {            this.setEnd(null);        }    }