### Question:
CalendarBackend extends ObmSyncBackend<WindowingEvent> implements org.obm.push.ICalendarBackend { @Override public void delete(UserDataRequest udr, CollectionId collectionId, ServerId serverId, Boolean moveToTrash) throws CollectionNotFoundException, DaoException, UnexpectedObmSyncServerException, ItemNotFoundException { Folder folder = folderSnapshotDao.get(udr.getUser(), udr.getDevice(), collectionId); CalendarPath calendar = folder.getTypedBackendId(); if (serverId != null) { AccessToken token = getAccessToken(); try { logger.info("Delete event serverId {} in calendar {}", serverId, folder.getBackendId()); Event evr = getEventFromServerId(token, calendar, serverId); getCalendarClient().removeEventById(token, calendar.getPath(), evr.getObmId(), evr.getSequence(), true); } catch (ServerFault e) { throw new UnexpectedObmSyncServerException(e); } catch (EventNotFoundException e) { throw new ItemNotFoundException(e); } catch (org.obm.sync.NotAllowedException e) { logger.warn(e.getMessage(), e); throw new ItemNotFoundException(e); } } } @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 testDelete() throws Exception { CollectionId collectionId = CollectionId.of(1); int itemId = 3; ServerId serverId = collectionId.serverId(itemId); expect(folderSnapshotDao.get(user, device, collectionId)).andReturn(calendarFolder); expectGetAndRemoveEventFromId(itemId); mockControl.replay(); calendarBackend.delete(userDataRequest, collectionId, serverId, true); mockControl.verify(); }