if ((startTime.get(Calendar.HOUR_OF_DAY) == roomOccupationObj.getStartTime().get( Calendar.HOUR_OF_DAY)) && (startTime.get(Calendar.MINUTE) == roomOccupationObj.getStartTime().get( Calendar.MINUTE)) && (endTime.get(Calendar.HOUR_OF_DAY) == roomOccupationObj.getEndTime().get( Calendar.HOUR_OF_DAY)) && (endTime.get(Calendar.MINUTE) == roomOccupationObj.getEndTime().get( Calendar.MINUTE)) && room.equals(roomOccupationObj.getRoom()) && dayOfWeek.equals(roomOccupationObj.getDayOfWeek()) && getPeriod().equals(roomOccupationObj.getPeriod())) {
Calendar startTime = roomOccupationObj.getStartTime(); Calendar endTime = roomOccupationObj.getEndTime(); IRoom room = roomOccupationObj.getRoom(); DiaSemana dayOfWeek = roomOccupationObj.getDayOfWeek(); IPeriod period = roomOccupationObj.getPeriod();  if ((startTime.get(Calendar.HOUR_OF_DAY) == startTime.get(Calendar.HOUR_OF_DAY)) && (startTime.get(Calendar.MINUTE) == startTime.get(Calendar.MINUTE)) && (endTime.get(Calendar.HOUR_OF_DAY) == endTime.get(Calendar.HOUR_OF_DAY)) && (endTime.get(Calendar.MINUTE) == endTime.get(Calendar.MINUTE)) && getRoom().equals(room) && getDayOfWeek().equals(dayOfWeek) && getPeriod().equals(period)) {
    public boolean equals(Object obj) {        if (obj instanceof IRoomOccupation) {            IRoomOccupation roomOccupationObj = (IRoomOccupation) obj;            if ((startTime.get(Calendar.HOUR_OF_DAY) == roomOccupationObj.getStartTime().get(                    Calendar.HOUR_OF_DAY))                    && (startTime.get(Calendar.MINUTE) == roomOccupationObj.getStartTime().get(                            Calendar.MINUTE))                    && (endTime.get(Calendar.HOUR_OF_DAY) == roomOccupationObj.getEndTime().get(                            Calendar.HOUR_OF_DAY))                    && (endTime.get(Calendar.MINUTE) == roomOccupationObj.getEndTime().get(                            Calendar.MINUTE))                    && room.equals(roomOccupationObj.getRoom())                    && dayOfWeek.equals(roomOccupationObj.getDayOfWeek())                    && getPeriod().equals(roomOccupationObj.getPeriod())) {                return true;            }            return false;        }        return false;    }