@Test public void equals() throws Exception { assertTrue(event1.equals(event1)); assertTrue(event1.equals(event3)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Event event = (Event) o; if (id != event.id) return false; if (creator != event.creator) return false; if (end != null ? !end.equals(event.end) : event.end !=null) { return false; } if (start != null ? !start.equals(event.start) : event.start != null) { return false; } return location != null ? location .equals(event.location) : event.location == null; }
Event extends Occasion { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Event event = (Event) o; if (id != event.id) return false; if (creator != event.creator) return false; if (end != null ? !end.equals(event.end) : event.end !=null) { return false; } if (start != null ? !start.equals(event.start) : event.start != null) { return false; } return location != null ? location .equals(event.location) : event.location == null; } }
Event extends Occasion { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Event event = (Event) o; if (id != event.id) return false; if (creator != event.creator) return false; if (end != null ? !end.equals(event.end) : event.end !=null) { return false; } if (start != null ? !start.equals(event.start) : event.start != null) { return false; } return location != null ? location .equals(event.location) : event.location == null; } Event(int id,
                 String name,
                 Date start,
                 Date end,
                 Location location,
                 int creator,
                 int groupId); }
Event extends Occasion { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Event event = (Event) o; if (id != event.id) return false; if (creator != event.creator) return false; if (end != null ? !end.equals(event.end) : event.end !=null) { return false; } if (start != null ? !start.equals(event.start) : event.start != null) { return false; } return location != null ? location .equals(event.location) : event.location == null; } Event(int id,
                 String name,
                 Date start,
                 Date end,
                 Location location,
                 int creator,
                 int groupId); int getId(); void setId(int id); Date getEnd(); void setEnd(Date end); Date getStart(); void setStart(Date start); int getCreator(); void setCreator(int creator); String getStartString(); Location getLocation(); void setLocation(Location location); int getGroupId(); void setGroupId(int groupId); @Override boolean equals(Object o); @Override int hashCode(); }
Event extends Occasion { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Event event = (Event) o; if (id != event.id) return false; if (creator != event.creator) return false; if (end != null ? !end.equals(event.end) : event.end !=null) { return false; } if (start != null ? !start.equals(event.start) : event.start != null) { return false; } return location != null ? location .equals(event.location) : event.location == null; } Event(int id,
                 String name,
                 Date start,
                 Date end,
                 Location location,
                 int creator,
                 int groupId); int getId(); void setId(int id); Date getEnd(); void setEnd(Date end); Date getStart(); void setStart(Date start); int getCreator(); void setCreator(int creator); String getStartString(); Location getLocation(); void setLocation(Location location); int getGroupId(); void setGroupId(int groupId); @Override boolean equals(Object o); @Override int hashCode();  }