@Test public void equals() { NotificationParameters parameters1 = new NotificationParameters(); NotificationParameters parameters2 = new NotificationParameters(); assertEquals(parameters1, parameters2); assertEquals(parameters1.hashCode(), parameters2.hashCode()); NotificationFilterPreference filterPref1 = mock(NotificationFilterPreference.class); NotificationPreference pref1 = mock(NotificationPreference.class); NotificationFilter filter1 = mock(NotificationFilter.class); parameters1.user = new DocumentReference("xwiki", "XWiki", "Foo"); parameters1.onlyUnread = true; parameters1.format = NotificationFormat.ALERT; parameters1.blackList = Arrays.asList("foo", "bar"); parameters1.fromDate = new Date(4242); parameters1.endDate = new Date(4343); parameters1.expectedCount = 888; parameters1.filterPreferences = Collections.singletonList(filterPref1); parameters1.filters = Collections.singletonList(filter1); parameters1.preferences = Collections.singletonList(pref1); assertNotEquals(parameters1, parameters2); assertNotEquals(parameters1.hashCode(), parameters2.hashCode()); parameters2.user = new DocumentReference("xwiki", "XWiki", "Foo"); assertNotEquals(parameters1, parameters2); assertNotEquals(parameters1.hashCode(), parameters2.hashCode()); parameters2.onlyUnread = true; assertNotEquals(parameters1, parameters2); assertNotEquals(parameters1.hashCode(), parameters2.hashCode()); parameters2.format = NotificationFormat.ALERT; assertNotEquals(parameters1, parameters2); assertNotEquals(parameters1.hashCode(), parameters2.hashCode()); parameters2.blackList = Arrays.asList("foo", "bar"); assertNotEquals(parameters1, parameters2); assertNotEquals(parameters1.hashCode(), parameters2.hashCode()); parameters2.fromDate = new Date(4242); assertNotEquals(parameters1, parameters2); assertNotEquals(parameters1.hashCode(), parameters2.hashCode()); parameters2.endDate = new Date(4343); assertNotEquals(parameters1, parameters2); assertNotEquals(parameters1.hashCode(), parameters2.hashCode()); parameters2.expectedCount = 888; assertNotEquals(parameters1, parameters2); assertNotEquals(parameters1.hashCode(), parameters2.hashCode()); parameters2.filterPreferences = Collections.singletonList(filterPref1); assertNotEquals(parameters1, parameters2); assertNotEquals(parameters1.hashCode(), parameters2.hashCode()); parameters2.filters = Collections.singletonList(filter1); assertNotEquals(parameters1, parameters2); assertNotEquals(parameters1.hashCode(), parameters2.hashCode()); parameters2.preferences = Collections.singletonList(pref1); assertEquals(parameters1, parameters2); assertEquals(parameters1.hashCode(), parameters2.hashCode()); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } NotificationParameters that = (NotificationParameters) o; return new EqualsBuilder() .append(expectedCount, that.expectedCount) .append(user, that.user) .append(format, that.format) .append(endDate, that.endDate) .append(endDateIncluded, that.endDateIncluded) .append(fromDate, that.fromDate) .append(onlyUnread, that.onlyUnread) .append(blackList, that.blackList) .append(preferences, that.preferences) .append(filterPreferences, that.filterPreferences) .append(filters, that.filters) .isEquals(); }
NotificationParameters { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } NotificationParameters that = (NotificationParameters) o; return new EqualsBuilder() .append(expectedCount, that.expectedCount) .append(user, that.user) .append(format, that.format) .append(endDate, that.endDate) .append(endDateIncluded, that.endDateIncluded) .append(fromDate, that.fromDate) .append(onlyUnread, that.onlyUnread) .append(blackList, that.blackList) .append(preferences, that.preferences) .append(filterPreferences, that.filterPreferences) .append(filters, that.filters) .isEquals(); } }
NotificationParameters { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } NotificationParameters that = (NotificationParameters) o; return new EqualsBuilder() .append(expectedCount, that.expectedCount) .append(user, that.user) .append(format, that.format) .append(endDate, that.endDate) .append(endDateIncluded, that.endDateIncluded) .append(fromDate, that.fromDate) .append(onlyUnread, that.onlyUnread) .append(blackList, that.blackList) .append(preferences, that.preferences) .append(filterPreferences, that.filterPreferences) .append(filters, that.filters) .isEquals(); }  }
NotificationParameters { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } NotificationParameters that = (NotificationParameters) o; return new EqualsBuilder() .append(expectedCount, that.expectedCount) .append(user, that.user) .append(format, that.format) .append(endDate, that.endDate) .append(endDateIncluded, that.endDateIncluded) .append(fromDate, that.fromDate) .append(onlyUnread, that.onlyUnread) .append(blackList, that.blackList) .append(preferences, that.preferences) .append(filterPreferences, that.filterPreferences) .append(filters, that.filters) .isEquals(); }  @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
NotificationParameters { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } NotificationParameters that = (NotificationParameters) o; return new EqualsBuilder() .append(expectedCount, that.expectedCount) .append(user, that.user) .append(format, that.format) .append(endDate, that.endDate) .append(endDateIncluded, that.endDateIncluded) .append(fromDate, that.fromDate) .append(onlyUnread, that.onlyUnread) .append(blackList, that.blackList) .append(preferences, that.preferences) .append(filterPreferences, that.filterPreferences) .append(filters, that.filters) .isEquals(); }  @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); public DocumentReference user; public NotificationFormat format; public int expectedCount; public Date endDate; public boolean endDateIncluded; public Date fromDate; public Boolean onlyUnread; public Collection<String> blackList; public Collection<NotificationPreference> preferences; public Collection<NotificationFilterPreference> filterPreferences; public Collection<NotificationFilter> filters; }