@Test public void testEquals_DifferentName_AssertNotEqual() throws Exception { AuditEvent event1 = new AuditEvent("category1", "type"); AuditEvent event2 = new AuditEvent("category2", "type"); assertFalse(event1.equals(event2)); }
@Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof AuditEvent)) return false; return obj.hashCode() == hashCode(); }
AuditEvent { @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof AuditEvent)) return false; return obj.hashCode() == hashCode(); } }
AuditEvent { @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof AuditEvent)) return false; return obj.hashCode() == hashCode(); } AuditEvent(String name, String type); }
AuditEvent { @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof AuditEvent)) return false; return obj.hashCode() == hashCode(); } AuditEvent(String name, String type); String getName(); String getType(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
AuditEvent { @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof AuditEvent)) return false; return obj.hashCode() == hashCode(); } AuditEvent(String name, String type); String getName(); String getType(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }