@Test public void eventHasCustomHashCode() { Calendar c = Calendar.getInstance(); AuditEvent e1 = new AuditEvent(this.user, "ip", "action", "extra", this.doc, c); AuditEvent e2 = new AuditEvent(this.user, "ip", "action", "extra", this.doc, c); Assert.assertEquals(e1.hashCode(), e2.hashCode()); User u = Mockito.mock(User.class); when(u.getId()).thenReturn("wiki:XWiki.otherUser"); e2 = new AuditEvent(u, "ip", "action", "extra", this.doc, c); Assert.assertNotEquals(e1.hashCode(), e2.hashCode()); e2 = new AuditEvent(this.user, "ip2", "action", "extra", this.doc, c); Assert.assertNotEquals(e1.hashCode(), e2.hashCode()); e2 = new AuditEvent(this.user, "ip", "action2", "extra", this.doc, c); Assert.assertNotEquals(e1.hashCode(), e2.hashCode()); e2 = new AuditEvent(this.user, "ip", "action", "extra2", this.doc, c); Assert.assertNotEquals(e1.hashCode(), e2.hashCode()); e2 = new AuditEvent(this.user, "ip", "action", "extra", new DocumentReference("wiki", "Space", "OtherPage"), c); Assert.assertNotEquals(e1.hashCode(), e2.hashCode()); e2 = new AuditEvent(this.user, "ip", "action", "extra", this.doc, SecurityTestUtils.getCalendar(10)); Assert.assertNotEquals(e1.hashCode(), e2.hashCode()); Assert.assertNotEquals(new AuditEvent().hashCode(), e1.hashCode()); Assert.assertEquals(new AuditEvent().hashCode(), new AuditEvent().hashCode()); }
@Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this, false); }
AuditEvent { @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this, false); } }
AuditEvent { @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this, false); } AuditEvent();  AuditEvent(final User user, final String ip,
        final String action, final String extra,
        final DocumentReference entity,
        final Calendar time); }
AuditEvent { @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this, false); } AuditEvent();  AuditEvent(final User user, final String ip,
        final String action, final String extra,
        final DocumentReference entity,
        final Calendar time); @Nullable User getUser(); @Nullable String getIp(); @Nonnull String getAction(); @Nullable String getExtraInformation(); @Nullable DocumentReference getEntity(); @Nonnull Calendar getTime(); @Override String toString(); @Override boolean equals(Object other); @Override int hashCode(); JSONObject toJSON(); }
AuditEvent { @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this, false); } AuditEvent();  AuditEvent(final User user, final String ip,
        final String action, final String extra,
        final DocumentReference entity,
        final Calendar time); @Nullable User getUser(); @Nullable String getIp(); @Nonnull String getAction(); @Nullable String getExtraInformation(); @Nullable DocumentReference getEntity(); @Nonnull Calendar getTime(); @Override String toString(); @Override boolean equals(Object other); @Override int hashCode(); JSONObject toJSON();  }