@Test public void twoNotificationsShouldBeEqualIfTheyWrapEqualMessagesAndEqualDetails() { Notification other = new Notification(notification.getMessage(), notification.getDetail()); assertEquals(notification, other); assertThat(notification.hashCode(), is(equalTo(other.hashCode()))); }
@Test public void twoNotificationsShouldNotBeEqualIfTheyWrapUnequalMessages() { Notification other = new Notification(notification.getMessage() + "Y", notification.getDetail()); assertNotEquals(notification, other); }