### Question:
SummaryLoggerService { public void logIncomingSync(Sync analyseSync) { if (!loggerIn.isInfoEnabled()) { return; } Summary summary = Summary.empty(); for (AnalysedSyncCollection collection : analyseSync.getCollections()) { summary = summary.merge(collection.getSummary()); } loggerIn.info(summary.summary()); } @Inject @VisibleForTesting  SummaryLoggerService(
			@Named(LoggerModule.SUMMARY_IN) Logger loggerIn,
			@Named(LoggerModule.SUMMARY_OUT) Logger loggerOut); void logIncomingSync(Sync analyseSync); void logOutgoingSync(SyncResponse response); void logOutgoingFolderSync(FolderSyncResponse folderSyncResponse); void logIncomingMoveItem(MoveItemsRequest moveItemsRequest); void logOutgoingMoveItem(MoveItemsResponse moveItemsResponse);  }### Answer:
@Test public void syncLoggerInWhenInfoNotEnabled() { Sync sync = Sync.builder() .addCollection(AnalysedSyncCollection.builder() .collectionId(CollectionId.of(1)) .syncKey(new SyncKey("123")) .dataType(PIMDataType.EMAIL) .build()) .build(); expect(loggerIn.isInfoEnabled()).andReturn(false); mocks.replay(); testee.logIncomingSync(sync); mocks.verify(); }
@Test public void syncLoggerInWhenNoCollection() { Sync sync = Sync.builder().build(); expect(loggerIn.isInfoEnabled()).andReturn(true); loggerIn.info("CHANGE: 0, DELETE: 0, FETCH: 0"); expectLastCall(); mocks.replay(); testee.logIncomingSync(sync); mocks.verify(); }
@Test public void syncLoggerInWhenMergeOfCollection() { Sync sync = Sync.builder() .addCollection(AnalysedSyncCollection.builder() .collectionId(CollectionId.of(1)) .syncKey(new SyncKey("123")) .dataType(PIMDataType.EMAIL) .command(SyncCollectionCommandRequest.builder().type(SyncCommand.FETCH).serverId(CollectionId.of(1).serverId(2)).build()) .build()) .addCollection(AnalysedSyncCollection.builder() .collectionId(CollectionId.of(3)) .syncKey(new SyncKey("456")) .dataType(PIMDataType.CALENDAR) .command(SyncCollectionCommandRequest.builder().type(SyncCommand.CHANGE).serverId(CollectionId.of(1).serverId(3)).build()) .build()) .build(); expect(loggerIn.isInfoEnabled()).andReturn(true); loggerIn.info("CHANGE: 1, DELETE: 0, FETCH: 1"); expectLastCall(); mocks.replay(); testee.logIncomingSync(sync); mocks.verify(); }