### Question:
CalendarBackend extends ObmSyncBackend<WindowingEvent> implements org.obm.push.ICalendarBackend { @VisibleForTesting <B extends WindowingEventChanges.Builder> void appendChangesToBuilder(UserDataRequest udr, AccessToken token, EventChanges changes, B builder) throws ServerFault, DaoException, ConversionException { String userEmail = getCalendarClient().getUserEmail(token); Preconditions.checkNotNull(userEmail, "User has no email address"); appendUpdatesEventFilter(changes.getUpdated(), userEmail, udr, builder); appendDeletions(changes.getDeletedEvents(), builder); } @Inject @VisibleForTesting  CalendarBackend(MappingService mappingService, 
			CalendarClient.Factory calendarClientFactory, 
			EventConverter eventConverter, 
			EventService eventService,
			ConsistencyEventChangesLogger consistencyLogger,
			EventExtId.Factory eventExtIdFactory,
			WindowingDao windowingDao,
			ClientIdService clientIdService,
			Ical4jHelper ical4jHelper, 
			Ical4jUser.Factory ical4jUserFactory,
			DateService dateService,
			OpushResourcesHolder opushResourcesHolder,
			FolderSnapshotDao folderSnapshotDao); @Override PIMDataType getPIMDataType(); @Override BackendFolders getBackendFolders(final UserDataRequest udr); @Override int getItemEstimateSize(UserDataRequest udr, ItemSyncState state, CollectionId collectionId, SyncCollectionOptions collectionOptions); @Override ServerId createOrUpdate(UserDataRequest udr, CollectionId collectionId,
			ServerId serverId, String clientId, IApplicationData data); @Override void delete(UserDataRequest udr, CollectionId collectionId, ServerId serverId, Boolean moveToTrash); @Override ServerId handleMeetingResponse(UserDataRequest udr, Object iCalendar, AttendeeStatus status); @Override List<ItemChange> fetch(UserDataRequest udr, CollectionId collectionId, List<ServerId> fetchServerIds, SyncCollectionOptions syncCollectionOptions,
				ItemSyncState previousItemSyncState, SyncKey newSyncKey); @Override List<ItemChange> fetch(UserDataRequest udr, CollectionId collectionId, List<ServerId> fetchServerIds, SyncCollectionOptions syncCollectionOptions); @Override ServerId move(UserDataRequest udr, Folder srcFolder, Folder dstFolder,
			ServerId serverId); @Override void emptyFolderContent(UserDataRequest udr, Folder folder,
			boolean deleteSubFolder); @Override void initialize(DeviceId deviceId, CollectionId collectionId, FilterType filterType, SyncKey newSyncKey); @Override BackendId createFolder(UserDataRequest udr, FolderCreateRequest folderCreateRequest,
			Optional<BackendId> backendId);  }### Answer:
@Test public void appendChangesToBuilderMustNotTransformDeclinedEventIntoRemoved() throws ServerFault, DaoException, ConversionException { EventObmId eventObmId = new EventObmId(132453); EventExtId eventExtId = new EventExtId("event-ext-id-bla-bla"); Attendee attendee = UserAttendee.builder().email(user.getLoginAtDomain()).participation(Participation.declined()).build(); Event event = new Event(); event.setExtId(eventExtId); event.setUid(eventObmId); event.addAttendee(attendee); DeletedEvent deletedEvent = createDeletedEvent(eventObmId, eventExtId); EventChanges eventChanges = EventChanges.builder() .deletes(Arrays.asList(deletedEvent)) .updates(Arrays.asList(event)) .lastSync(org.obm.DateUtils.date("2012-10-10")) .build(); expect(calendarClient.getUserEmail(token)).andReturn("test@test").anyTimes(); mockControl.replay(); WindowingEventChanges.Builder builder = WindowingEventChanges.builder(); calendarBackend.appendChangesToBuilder(userDataRequest, token, eventChanges, builder); mockControl.verify(); assertThat(builder.build().deletions()).hasSize(1).containsOnly( WindowingEvent.builder() .uid(132453) .build()); }