@Test public void testDeletesFromNotification() { final ImmutableList<String> ids = ImmutableList.of("1", "2", "3"); final NotificationListDeletion update = new NotificationListDeletion(ids); final NotificationListObject original = new NotificationListObject(); final NotificationListObject expected = new NotificationListObject(); expected.deleteNotifications(ids); final NotificationListObject actual = update.apply(original); assertThat(actual).isEqualTo(expected); }
@Override public NotificationListObject apply(@Nullable NotificationListObject original) { if (original == null) { LOGGER.debug("original is null, creating new notification list"); original = new NotificationListObject(); } original.deleteNotifications(ids); return original; }
NotificationListDeletion extends UpdateValue.Update<NotificationListObject> { @Override public NotificationListObject apply(@Nullable NotificationListObject original) { if (original == null) { LOGGER.debug("original is null, creating new notification list"); original = new NotificationListObject(); } original.deleteNotifications(ids); return original; } }
NotificationListDeletion extends UpdateValue.Update<NotificationListObject> { @Override public NotificationListObject apply(@Nullable NotificationListObject original) { if (original == null) { LOGGER.debug("original is null, creating new notification list"); original = new NotificationListObject(); } original.deleteNotifications(ids); return original; } NotificationListDeletion(final Collection<String> ids); }
NotificationListDeletion extends UpdateValue.Update<NotificationListObject> { @Override public NotificationListObject apply(@Nullable NotificationListObject original) { if (original == null) { LOGGER.debug("original is null, creating new notification list"); original = new NotificationListObject(); } original.deleteNotifications(ids); return original; } NotificationListDeletion(final Collection<String> ids); @Override NotificationListObject apply(@Nullable NotificationListObject original); }
NotificationListDeletion extends UpdateValue.Update<NotificationListObject> { @Override public NotificationListObject apply(@Nullable NotificationListObject original) { if (original == null) { LOGGER.debug("original is null, creating new notification list"); original = new NotificationListObject(); } original.deleteNotifications(ids); return original; } NotificationListDeletion(final Collection<String> ids); @Override NotificationListObject apply(@Nullable NotificationListObject original);  }