### Question:
CalendarBackend extends ObmSyncBackend<WindowingEvent> implements org.obm.push.ICalendarBackend { @VisibleForTesting boolean belongsToCalendar(Event oldEvent, String calendarName) { Preconditions.checkArgument(!Strings.isNullOrEmpty(calendarName)); return calendarName.equalsIgnoreCase(oldEvent.getOwner()); } @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(expected=IllegalArgumentException.class) public void testBelongsToCalendarWhenNullCalendar() { Event event = new Event(); calendarBackend.belongsToCalendar(event, null); }
@Test(expected=IllegalArgumentException.class) public void testBelongsToCalendarWhenEmptyCalendar() { Event event = new Event(); calendarBackend.belongsToCalendar(event, ""); }
@Test public void testBelongsToCalendarWhenOwnerIsNull() { Event event = new Event(); event.setOwner(null); assertThat(calendarBackend.belongsToCalendar(event, "owner")).isFalse(); }
@Test public void testBelongsToCalendarWhenOwnerIsEmpty() { Event event = new Event(); event.setOwner(""); assertThat(calendarBackend.belongsToCalendar(event, "owner")).isFalse(); }
@Test public void testBelongsToCalendarWhenOwnerIsDifferent() { Event event = new Event(); event.setOwner("owner"); assertThat(calendarBackend.belongsToCalendar(event, "user@email.com")).isFalse(); }
@Test public void testBelongsToCalendarWhenCalendarEqualsOwner() { Event event = new Event(); event.setOwner("owner"); assertThat(calendarBackend.belongsToCalendar(event, "owner")).isTrue(); }
@Test public void testBelongsToCalendarWhenCalendarEqualsOwnerDifferentCase() { Event event = new Event(); event.setOwner("OWNER"); assertThat(calendarBackend.belongsToCalendar(event, "owner")).isTrue(); }
@Test public void testBelongsToCalendarWhenCalendarNotEqualsOwnerButCreator() { Event event = new Event(); event.setOwner("owner"); event.setCreatorEmail("creator@email.com"); assertThat(calendarBackend.belongsToCalendar(event, "creator@email.com")).isFalse(); }